DocumentationQuickstart
Ask AI

Take the docs with you

Ask ChatGPTOpen a new chat ↗Ask ClaudeOpen a new chat ↗Ask on GeminiCopy prompt, then paste in Gemini ↗View llms.txtDocumentation index ↗

External chats receive links to public docs.

Quickstart

Only endpoints that intentionally differ from the standard API carry a chip; the chip links to the note that explains the difference.

AtmoRouter speaks both the OpenAI Chat Completions API and the Anthropic Messages API. If your code already talks to either one, you only change two things: the base URL and the key. Request shape, streaming format, and response fields follow the same format.

/v1/chat/completions/v1/models
Two credentials for two surfaces. Inference takes a Bearer ar- key (or x-api-key); the dashboard uses a session cookie instead. An ar- key never acts as a session, and a session cookie never authenticates inference.

1. Create an account and a key

Sign up, then open Dashboard → API Keys and create a key. The full secret is shown once. Store it somewhere safe. Keys look like ar- followed by 48 hex characters.

Atmo keys stay on Atmo. Atmo keys carry the ar- prefix. An Atmo key works only here — keys are not portable to other gateways, and a key issued by another gateway does not work here.

2. Add balance

Deposit USDC on Solana or pay with QRIS under Dashboard → Deposit. Balance is consumed per token; there is no subscription and no minimum monthly spend. A request is rejected with HTTP 402 when your balance reaches zero.

3. Make your first call

Before paid calls, open Dashboard → Budgets to set a minimum percentage off official rates for all models, a family, or one model. See Budgets for account and API key limits, the 30-second routing wait, and the per-request minimum.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://atmorouter.dev/v1",
    api_key="ar-xxxxxxxxxxxx",
)

response = client.chat.completions.create(
    model="cbcn/glm-5.3",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)
print(response.usage)
bash
curl https://atmorouter.dev/v1/chat/completions \
  -H "Authorization: Bearer ar-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cbcn/glm-5.3",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Non-streaming responses include an X-Atmorouter-Cost header with the exact amount deducted for that request, so you can reconcile spend without polling the dashboard.
Retry only what is transient. Retry 429, 502 and 503 with exponential backoff. 402 means your balance is empty, so top up instead of retrying. Never retry 400, 401, 403 or 404.

4. Check what you were charged

Open Dashboard → Usage logs. Every request is listed with input tokens, output tokens, latency and cost, plus how much you saved versus the model's official list price.