Models, Routing & Thinking
A Model Route (/models) maps a client-facing Model ID to one or more upstream provider targets with explicit purpose validation, priority tiers, failure recovery, and optional client billing.

Prerequisites
- At least one configured provider: Ensure the provider's Upstream models list shows the target model you want to bind.
Route purpose (single purpose per route)
Every route declares one purpose (replacing legacy output-modality selectors):
| Purpose | Intended use | Eligible upstream models |
|---|---|---|
Inference (inference) | Chat, Responses, Messages, Gemini, Media understanding, Platform tasks, and Local Web Search reasoning | Models capable of text/multimodal inference |
Image Generation (image_generation) | Media generation (generate tool / image endpoints) | Upstream models reporting image generation capability |
Web Search (web_search) | External Route backend in Web Search (DeepSeek, Codex, Antigravity native search) | Upstream models with native search capability |
web_search routes do not appear in client model catalogs or Console Chat. If you change an existing route's purpose, any incompatible targets—even disabled ones—must be removed or replaced before saving. Trait tags such as image_input, reasoning, structured_output, or upstream endpoint paths do not block inference or web_search eligibility; only explicit operation capabilities (infer, search, media_image, image_output) restrict route purposes.
Steps
Create, search, or compare routes
On
/models, use instant keyword search across display names, clientModel IDs, target models, provider names, status, and route purpose. You can also click Model Picker (https://model-picker.stravia.cn/) from the header to explore upstream models, or click New model (/models/new) to create a route.Bind targets into priority lanes

Drag targets using the mouse or touch handle across Lane 0, lower-priority backup lanes, or the disabled pool:
- Balance mode: Choose Traffic equalization or Latency preference within a lane.
- Priority & affinity: Normally Stravia exhausts higher-priority lanes before trying lower-priority backup lanes; note that active session affinity rules can prioritize an affinity target before plain lane order.
- Per-target resilience: Configure First-token timeout (
first_token_timeout_ms), Target retry budget (target_retry_budget), and Target cooldown (target_cooldown_ms).
Review thinking-level mappings
For
inferenceroutes, Stravia maps client thinking levels (off,minimal,low,medium,high,xhigh,max) using canonical effort controls only: each row either maps to an upstream level (Map to level /Effort) or skips the target for that level (Disable level /Hidden). Legacy manual-budget models (older Claude, Bedrock Claude, Gemini 2.5, Cohere) and toggle-based vendors (DeepSeek, Xiaomi, Zhipu/ZAI, Alibaba/Qwen, Baseten, MiniMax M3, pure-toggle Kiro) translate canonical efforts at egress via shared static budget tables (minimal: 1024,low: 2048,medium: 8192,high: 16384,xhigh: 24576,max: 32768) or vendor-native switches. Open any target card if Thinking map needs a change appears and adjust or disable affected rows.Breaking in v0.7.6 for legacy thinking budgetsInbound Anthropic requests sending
thinking.type = "enabled"or non-nullthinking.budget_tokens, and Google Gemini requests sending non-nullthinkingConfig.thinkingBudget, are rejected with HTTP400. Migrate clients to Anthropicthinking: {"type": "adaptive"}+output_config.effort(orthinking: {"type": "disabled"}) and GeminithinkingConfig.thinkingLevel.Understand pre-commit failover & upstream RPM queues
- Pre-commit failover: Before output commits to the client, Stravia can retry the same target or move to another eligible target on retryable failures (respecting
Retry-Afterwithout exceeding the overall request deadline). A clean empty-stream EOF before any output commits can trigger at most one extra retry on the same target (when policy permits) before failing over to the next target. Non-recoverable errors such as context-length exceeded, content filtering, or invalid parameters stop immediately. - Upstream RPM queue: If an upstream model has a shared RPM limit configured on
/providers/[id], all routes sharing that target model share that queue, controlled globally via Settings → Upstream RPM queue.
- Pre-commit failover: Before output commits to the client, Stravia can retry the same target or move to another eligible target on retryable failures (respecting
Configure optional Route Billing
Independent of provider cost tracking, you can enable route Billing (
per_callfixed amount orper_tokentiered pricing with optional timezone peak windows) in USD or your configured custom currency.
Verify
Save the route, confirm every intended target sits in an active lane without purpose or thinking-mapping badges, and test a request through Chat (/) or an API key.
Troubleshooting
- Target shows "Purpose does not match this route": The bound upstream model does not advertise capabilities matching the route's selected
purpose. Remove the target or switch the route'spurpose. - Route missing from
Connect clientsor/codex/models: Confirm the route is enabled, itspurposeisinference(orimage_generationwhere supported), and the selected API key authorizes it.
Next
- API Keys, Spend Limits & Access — authorize clients to call your new
Model ID. - Providers & Credentials — configure upstream model RPM limits and cost tracking.