Developer Access

Connect to The SmarToken with a few lines of code. Console-issued sk keys are separate from upstream vendor secrets and should never be exposed in browsers.

Install an SDK (optional)

You can call the API directly over HTTP; the command below is a minimal example.

pip install openai
# Same OpenAI SDK pattern: set base_url to the Base URL below (.../v1)

Authentication

Send Authorization: Bearer sk-..., created in the console.

Make a request - Chat Completions

https://thesmartoken.com/v1/chat/completions

curl -s "https://thesmartoken.com/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_CONSOLE_SK" \
  -d '{
    "model": "gpt-4o-mini",
    "stream": false,
    "messages": [
      { "role": "user", "content": "Explain recursion in one sentence" }
    ]
  }'

Streaming

This gateway currently prioritizes complete JSON responses with stream:false. SSE streaming can be enabled in a later iteration with billing alignment.

Common errors

  • 401 - The console sk key is invalid or revoked.
  • 402 - Insufficient balance.
  • 429 - Gateway rate limit reached.

Base URL (OpenAI-compatible)

https://thesmartoken.com/v1

Set baseURL to the address above in OpenAI-compatible clients; the full request URL isPOST https://thesmartoken.com/v1/chat/completions.