TokenRoute
Get started

An OpenAI-compatible API for 446 models

TokenRoute implements the OpenAI /v1/chat/completions interface. If your code already talks to OpenAI, you change two things, the base URL and the API key, and it talks to 446 models instead of one provider’s.

What stays the same

  • The official OpenAI SDKs for Python, Node and every other language.
  • Request and response shapes: messages, choices, usage, tool calls and the rest of the schema.
  • Streaming over Server-Sent Events, with the same chunk format.
  • Anything built on the OpenAI interface: LangChain, LlamaIndex, Vercel AI SDK.

What changes

The base URL becomes https://tokenroute.app/api/v1, the key becomes a TokenRoute key, and the model string can name any model in the catalog.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://tokenroute.app/api/v1",
    api_key="sk-tr-...",          # your TokenRoute key
)

response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4.5",   # swap this string for any model
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
typescript
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://tokenroute.app/api/v1',
  apiKey: process.env.TOKENROUTE_API_KEY,
})

const response = await client.chat.completions.create({
  model: 'openai/gpt-5',
  messages: [{ role: 'user', content: 'Hello!' }],
})
bash
curl https://tokenroute.app/api/v1/chat/completions \
  -H "Authorization: Bearer $TOKENROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-2.5-flash",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Switching models

Every model is addressed as provider/model, for example openai/gpt-5, anthropic/claude-opus-4.6, google/gemini-2.5-pro, deepseek/deepseek-chat. Changing provider means changing that string; there is no second SDK, key or invoice. Browse every identifier on the models page.