Documentation

DOCS.

Everything you need to point your app at Switchlo instead of a single LLM provider — one endpoint, automatic failover, and per-provider budgets you control.

Quickstart

Create an API key from your dashboard, then point your existing OpenAI-compatible client at the Switchlo endpoint. Switchlo forwards the request to whichever connected provider is healthy and under budget.

curl https://api.switchlo.dev/v1/chat/completions \
  -H "Authorization: Bearer sw_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

Setting model to "auto" lets Switchlo pick the best available provider. You can also pin a specific provider and let Switchlo handle failover only when it throttles or errors.

Authentication

Every request needs a Switchlo API key in the Authorization header, formatted as Bearer sw_live_<key>. Keys are scoped to your account and can be revoked at any time from the dashboard.

Switchlo never sees your underlying provider credentials in plaintext on the wire between your app and our router — connect your provider keys once, and requests are signed server-side.

How routing works

Switchlo tracks per-provider rate limits and remaining cost budget in real time. When a request comes in, it picks the healthiest provider that fits the request, and sends it.

If a provider throttles or errors mid-request, Switchlo retries against the next best provider automatically — before the failure ever reaches your app. Typical added latency for a failover is under 80ms.

Providers

Switchlo currently routes across:

  • Groq
  • Cerebras
  • Google Gemini
  • OpenAI
  • Anthropic
  • OpenRouter
  • Mistral
  • DeepSeek

Connect the providers you use from the dashboard's provider settings.

API reference

Switchlo exposes an OpenAI-compatible /v1/chat/completions endpoint, so most existing SDKs work by changing only the base URL and API key.

FieldTypeDescription
modelstringProvider model name, or "auto" to let Switchlo choose
messagesarrayChat messages, same shape as the OpenAI Chat Completions API
streambooleanStream tokens as server-sent events

Errors

Switchlo only returns an error once every connected, budget-eligible provider has been exhausted. Error bodies match the OpenAI error shape, with an added switchlo_meta field listing which providers were attempted.