Quick Start

Integrate ThisToken.AI API in under 5 minutes

1

Sign Up

Visit the ThisToken.AI signup page, enter your email and password to register. You'll receive $5 in free trial credit on signup.

2

Get an API Key

Log into the console and create a new API Key under Settings → API Keys. Keep your key safe and never share it.

3

Install the SDK

If you already use the OpenAI SDK, no extra packages are needed. Otherwise run:

npm install openai
4

Write Code

Use the following code sample to call the API:

import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.thistoken.ai/v1',
  apiKey: 'your-api-key', // your API Key
})

async function main() {
  const response = await client.chat.completions.create({
    model: 'gpt-4o',
    messages: [
      { role: 'system', content: 'You are a helpful assistant.' },
      { role: 'user', content: 'Hello!' }
    ],
  })

  console.log(response.choices[0].message.content)
}

main()
5

Start Using

Run your code to start using AI models. View usage and costs in the console.

💡 Tips

  • Never hardcode your API Key in client-side code
  • Store the API Key in environment variables
  • Set usage budgets and alerts in the console
  • Contact support anytime if you hit a problem