Synrouter Docs
Quickstart
Use Synrouter by changing your base URL and sending an sk-sr API key. Works with any OpenAI-compatible or Anthropic-compatible client — no SDK changes needed.
1. Choose a base URL
For OpenAI-compatible SDKs, set the base URL to https://synrouter.ai/api/v1.
For Anthropic-compatible clients, set the base URL to https://synrouter.ai/api/anthropic.
Synrouter is fully protocol-compatible — any library that works with the OpenAI or Anthropic API will work with Synrouter by changing only the base URL and API key.
2. Authenticate
Send your Synrouter API key in the Authorization header as a Bearer token. Keys use the sk-sr-* prefix.
3. Make your first request
4. Streaming
Set stream: true to receive server-sent events (SSE) — fully compatible with OpenAI and Anthropic streaming protocols.
OpenAI SDK — Python
OpenAI SDK — TypeScript
Anthropic-compatible request
Error handling
Synrouter returns standard HTTP status codes:
- 200 — Success. Check
x-synrouter-*headers for savings info. - 401 — Missing or invalid API key. Verify your
Authorizationheader. - 429 — Rate limited. Back off and retry after the
Retry-Afterduration. - 500 — Upstream provider error. Synrouter retries with exponential backoff before surfacing the error.