Skip to main content
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 at POST /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

Always use "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 with routor_tier to skip classification and force a specific tier
  • "direct". Bypass routing entirely and proxy straight to the model named in model. The model field must be a valid model ID from GET /v1/models

routor_tier

Only used when routor_profile: "tier". Forces routing to this exact tier, bypassing classification. Example. always use STANDARD regardless of prompt:

routor_tier_floor

Sets the minimum tier. Any request classified below this floor is bumped up to the floor. Example. never go below STANDARD:

routor_tier_ceiling

Sets the maximum tier. Any request classified above this ceiling is capped at the ceiling. Example. cap at LIGHT to limit cost:

routor_max_cost

Sets a maximum estimated cost per request in USD. Models whose estimated cost exceeds this are filtered out of the candidate chain. Falls back to the full chain if no model qualifies.

routor_bfcl_min

Minimum BFCL (function-calling) score a model must meet to stay in the candidate chain. Only meaningful when your request includes tools. Falls back to the full chain if no model qualifies.

routor_code_quality / routor_chat_quality

Quality sliders that map to a tier floor. 0 = Fast (no floor), 1 = Balanced, 2 = Best.
  • routor_code_quality applies when the prompt looks like a coding task (floors: STANDARD for 1, COMPLEX for 2)
  • routor_chat_quality applies otherwise (floors: LIGHT for 1, STANDARD for 2)
The slider floor is merged with any explicit routor_tier_floor - the higher of the two wins.

Response Format

Identical to the OpenAI Chat Completions response, plus a routor object with routing metadata:
Note: the 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 includes X-Request-Id. When the server has DEBUG_ROUTING=1 set, routing metadata is also exposed in headers:
Without that flag, use the routor object in the response body (shown above) instead.

Streaming

Streaming works exactly like OpenAI streaming:

Error Handling

Routor returns standard HTTP errors: