Documentation

BaseRouter speaks OpenAI's chat completions API. Anything that targets api.openai.com/v1 works against api.baserouter.dev/v1 — only the key and base URL change.

Quick start

curl https://api.baserouter.dev/v1/chat/completions \
  -H "Authorization: Bearer $BASEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Authentication

Every request needs an Authorization: Bearer sk-sr-… header. Create keys in the dashboard. Revoke any time.

Models

Pass any slug from the model catalog as the model field. BaseRouter routes each call to the best available upstream provider.

Streaming

Add stream: true and consume the SSE response. Identical to OpenAI's streaming format.

Errors

  • 401 — missing or invalid API key.
  • 402 — your credit balance is zero. Top up at /dashboard/credits.
  • 429 — upstream rate limited. Retry shortly.
  • 400 — invalid request body. Check the response for the offending field.