Back to Home

Quickstart

Integrate Tokensmart and make your first API call in under 5 minutes.

Step 1: Sign up

Go to the login page and sign up with your email. New users automatically receive a welcome credit.

Step 2: Create an API key

  1. Open the API Keys page
  2. Click "Create new key"
  3. Give it a name (for example my-app-dev)
  4. Save the key that appears — it starts with pk_live_ and is only shown once

⚠️ API keys are like passwords. If one leaks, delete and regenerate it immediately.

Step 3: Make your first request

Test it with curl:

curl https://api.tokensmart.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxx" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      { "role": "user", "content": "Hello, Tokensmart!" }
    ]
  }'

You should get a JSON response in exactly the same format OpenAI returns.

Step 4: Use an SDK

If your project uses the OpenAI Python SDK:

from openai import OpenAI

client = OpenAI(
    api_key="pk_live_xxxxxxxxxxxxxxxx",
    base_url="https://api.tokensmart.ai/v1",
)

resp = client.chat.completions.create(
    model="claude-sonnet-4-6",  # Yes, you can call Claude too!
    messages=[{"role": "user", "content": "Write me a limerick"}],
)

print(resp.choices[0].message.content)

That is it. You can now switch between OpenAI and Claude inside the same SDK without changing any code.

Next steps