Docs navigation

Getting started

Models & routing

Model IDs, bare aliases, and the auto router.

TokenRouter addresses models as provider/model across all 13 providers. The same ID works on every endpoint that accepts a model field.

Model IDs

text
openai/gpt-5-mini
anthropic/claude-sonnet-4-5
google/gemini-2.5-pro
deepseek/deepseek-chat
mistral/mistral-large-latest
groq/llama-3.3-70b-versatile
xai/grok-4
qwen/qwen3-max

Bare aliases

If a model name is unambiguous, you can omit the provider prefix. gpt-5-mini resolves to openai/gpt-5-mini; claude-sonnet-4-5 resolves to anthropic/claude-sonnet-4-5. Prefer fully-qualified IDs in production code.

Auto-routing

Pass auto and TokenRouter picks a model for the request among the providers you have keys for, respecting your team’s model allowlist. Bias the choice with a strategy suffix:

Model valueStrategy
autoBalanced default (same as auto:balanced)
auto:costCheapest capable model
auto:latencyFastest time-to-first-token
auto:qualityStrongest available model
auto:balancedWeighs cost, latency, and quality
bash
curl https://api.tokenrouter.io/v1/chat/completions \
  -H "Authorization: Bearer tr_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto:cost",
    "messages": [{"role": "user", "content": "Summarize this in one line: ..."}]
  }'

The chosen model is returned in the response’s model field and in usage analytics, so attribution stays exact.

Listing models

GET /v1/models returns every model available to your key — the catalog filtered by your provider keys and your team’s allowlist:

bash
curl https://api.tokenrouter.io/v1/models \
  -H "Authorization: Bearer tr_your_key_here"