Skip to content
Go To Dashboard

Router API reference

Sapiom Router accepts LLM requests from your application using a Sapiom API key. Choose a model, then use the request format your application already understands.

Base URL: https://router.sapiom.ai

Open Router in the dashboard to inspect Router activity. For LLM calls inside a deployed Sapiom agent, see Choose a call surface.

Set SAPIOM_API_KEY to your Sapiom API key in the environment where you run the examples. Send it in either Authorization: Bearer or x-api-key. Router authenticates your Sapiom account; you do not supply a provider API key.

FormatEndpoint
Anthropic MessagesPOST /v1/messages
OpenAI Chat CompletionsPOST /v1/chat/completions
OpenAI ResponsesPOST /v1/responses

Each endpoint accepts its named request format and returns that format’s response. Router translates between formats when the selected provider uses a different one.

For Responses requests translated to another format, previous_response_id is not supported. Include the conversation in input instead. Responses requests do not fall back to a different model class.

Use a request ID or alias in the JSON model field.

All listed models support the request formats above, including streaming.

Request IDAliases
claude-haiku-4-5anthropic/claude-haiku-4-5, claude-haiku-4-5-20251001, haiku
claude-opus-4-7anthropic/claude-opus, anthropic/claude-opus-4-7, claude-opus, opus
claude-opus-5-5anthropic/claude-opus-5-5
claude-sonnetanthropic/claude-sonnet, claude-sonnet-4-6, sonnet-4.6-anthropic
claude-sonnet-5anthropic/claude-sonnet-5, sonnet
deepseek_4_1_flashfireworks-serverless-deepseek-4-1-flash
glm-priorityglm-5p3-fireworks-serverless-priority
gpt-6-lunagpt_6_luna, luna, openai-luna
gpt-lunagpt-5.6-luna
m3fireworks-m3-serverless, minimax-m3, minimax/minimax-m3, minimaxai/minimax-m3

A lane selects the latency and capacity policy for your request.

Set x-sapiom-lane in any request format. The default is run_now.

Available lane
flex
run_now
standard

run_now prioritizes latency for interactive work. When available, standard balances latency and serving cost, and flex accepts slower performance for delay-tolerant work. Lanes influence routing, capacity admission, and fallback budgets.

flex uses the same request and streaming APIs. It does not submit an asynchronous job. A request can return HTTP 429 if capacity admission fails; a rejected request is not queued for later execution.

Terminal window
curl -sS -X POST 'https://router.sapiom.ai/v1/messages' \
-H "Authorization: Bearer $SAPIOM_API_KEY" \
-H 'Content-Type: application/json' \
-H 'x-sapiom-lane: run_now' \
-H 'anthropic-version: 2023-06-01' \
-d '{
"model": "claude-haiku-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}'

For streaming with this model and format, add "stream": true to the JSON body and -N to curl.

Terminal window
curl -sS -X POST 'https://router.sapiom.ai/v1/chat/completions' \
-H "Authorization: Bearer $SAPIOM_API_KEY" \
-H 'Content-Type: application/json' \
-H 'x-sapiom-lane: run_now' \
-d '{
"model": "claude-haiku-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}'

For streaming with this model and format, add "stream": true to the JSON body and -N to curl.

Terminal window
curl -sS -X POST 'https://router.sapiom.ai/v1/responses' \
-H "Authorization: Bearer $SAPIOM_API_KEY" \
-H 'Content-Type: application/json' \
-H 'x-sapiom-lane: run_now' \
-d '{
"model": "claude-haiku-4-5",
"max_output_tokens": 256,
"input": "Say hello."
}'

For streaming with this model and format, add "stream": true to the JSON body and -N to curl.