Synrouter Docs
API reference
Synrouter exposes OpenAI-compatible, Anthropic-compatible, and Synrouter-specific public endpoints for model inference and pricing metadata.
Authentication
Authenticate API calls with a Synrouter key in the Authorization header.
http
1Authorization: Bearer sk-sr-...
Public endpoints
GET /v1/models
Returns the current OpenAI-compatible model list.
POST /v1/chat/completions
Creates a chat completion through the OpenAI-compatible API.
POST /anthropic/v1/messages
Creates a message through the Anthropic-compatible API.
GET /api/sr/pricing
Returns Synrouter pricing metadata for configured models.
Chat Completions
Use this endpoint with OpenAI-compatible SDKs and clients. The production base URL is https://synrouter.ai/api/v1.
bash
1curl https://synrouter.ai/api/v1/chat/completions \
2 -H "Authorization: Bearer sk-sr-..." \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "deepseek/deepseek-v4-flash",
6 "messages": [
7 { "role": "user", "content": "Return a JSON object with one greeting." }
8 ]
9 }'
Anthropic Messages
Use this endpoint with Anthropic-compatible clients. The production base URL is https://synrouter.ai/api/anthropic.
bash
1curl https://synrouter.ai/api/anthropic/v1/messages \
2 -H "Authorization: Bearer sk-sr-..." \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "anthropic/claude-sonnet-4.6",
6 "max_tokens": 256,
7 "messages": [
8 { "role": "user", "content": "Explain session-aware caching." }
9 ]
10 }'
Models
bash
1curl https://synrouter.ai/api/v1/models \
2 -H "Authorization: Bearer sk-sr-..."
Pricing
Pricing data is returned in USD per million tokens. Use it for display and estimation; the final bill is based on actual request usage.
bash
1curl https://synrouter.ai/api/sr/pricing
Synrouter response headers
x-synrouter-session-id: session identifier assigned by Synrouter.x-synrouter-cache-savings-usd: estimated savings from cache reads.x-synrouter-trim-savings-usd: estimated savings from tool-result reduction.x-synrouter-trimmed-tokens: estimated number of input tokens removed before routing.