Chat Completions
Routor is a drop-in replacement for the OpenAI Chat Completions API. Any SDK or tool that works with OpenAI works with Routor. Just change the base URL and API key. An Anthropic-compatible endpoint is also available atPOST /v1/messages for Claude Code and other Anthropic-format clients - it converts requests to the internal OpenAI shape, reuses the full routing/fallback/billing pipeline, and translates the response back to the Anthropic format.
Endpoint:
Request Format
Identical to the OpenAI Chat Completions API, with optional Routor-specific fields:The model Field
| Value | Behavior |
|---|---|
"auto" | Routor picks the model. full automatic routing |
| Any valid model ID | Routes directly to that model - only when paired with "routor_profile": "direct". Without it, the model field is ignored and routing runs as usual |
"auto" unless you have a specific reason to lock to a model. To force a specific model, set "routor_profile": "direct" and pass the model ID in model.
Routor-Specific Parameters
These fields are stripped before the request is forwarded to the provider. the provider never sees them.routor_profile
"auto"(default). Routor classifies the prompt and picks the tier"tier". Use withroutor_tierto skip classification and force a specific tier"direct". Bypass routing entirely and proxy straight to the model named inmodel. Themodelfield must be a valid model ID fromGET /v1/models
routor_tier
routor_profile: "tier". Forces routing to this exact tier, bypassing classification.
Example. always use STANDARD regardless of prompt:
routor_tier_floor
routor_tier_ceiling
routor_max_cost
routor_bfcl_min
routor_code_quality / routor_chat_quality
0 = Fast (no floor), 1 = Balanced, 2 = Best.
routor_code_qualityapplies when the prompt looks like a coding task (floors: STANDARD for1, COMPLEX for2)routor_chat_qualityapplies otherwise (floors: LIGHT for1, STANDARD for2)
routor_tier_floor - the higher of the two wins.
Response Format
Identical to the OpenAI Chat Completions response, plus aroutor object with routing metadata:
model field in the response shows the actual model used, not "auto". The routor object’s model may differ from the top-level model when a fallback was used.
Response Headers
Every response includesX-Request-Id. When the server has DEBUG_ROUTING=1 set, routing metadata is also exposed in headers:
routor object in the response body (shown above) instead. See Response Metadata for the full reference.
Streaming
Streaming works exactly like OpenAI streaming:Error Handling
Routor returns standard HTTP errors:| Status | Meaning |
|---|---|
400 | Bad request. missing or invalid fields |
401 | Invalid or missing API key |
402 | Insufficient credits |
429 | Rate limit exceeded |
503 | All providers in the fallback chain failed |