Router One
Router One

Quickstart

From zero to your first model response in about five minutes — with curl, the OpenAI SDK, or the Anthropic SDK.

1. Get an API key

2. Pick the right base URL

Router One exposes two protocol surfaces. Which base URL you use depends on the client — this is the single most common setup mistake:

Client / protocolBase URLNote
OpenAI SDK, Chat Completions, Responses, images, videos, Codex CLIhttps://api.router.one/v1With /v1
Anthropic SDK, Messages API, Claude Codehttps://api.router.oneWithout /v1 — the client appends /v1/messages itself
If you get a 404 (or an immediate 401) right after setup, check the base URL first: OpenAI-compatible clients need the /v1 suffix, Claude Code must not have it.

3. Send your first request

All endpoints authenticate with Authorization: Bearer <your key>. Pick your client:

bash
curl https://api.router.one/v1/chat/completions \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

4. Stream responses

Set stream: true to receive an SSE stream — same shape as the official APIs, ending with data: [DONE]. The clients below reuse the setup from step 3.

bash
curl -N https://api.router.one/v1/chat/completions \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "stream": true,
    "messages": [{"role": "user", "content": "Write a short poem"}]
  }'

5. Choose a model

Use model: "auto" to let the gateway route within a server-owned candidate set (latency, posted cost, and reliability signals), or pin an exact model ID. IDs are case-sensitive — copy them from the model catalog.

6. Handle errors

Errors use standard HTTP status codes with a JSON body. The gateway retries and fails over within the same model family on 5xx/timeouts automatically; your client still needs to handle these:

StatusMeaningWhat to do
401Invalid or missing API keyCheck the Authorization header and the key value.
402Insufficient balanceTop up in the dashboard, or raise the key's spend limit.
404Wrong path or base URLVerify the base URL rules from step 2.
429Rate limitedCheck Dashboard → Logs, back off and retry; contact support to raise limits.
5xxUpstream or gateway errorRetry with backoff; the gateway has already attempted a same-family failover.

Next steps