Choose a routing mode
Start withbalanced unless one production requirement clearly matters more than the others.
Configure the workspace default in Dashboard -> Settings -> Routing. Use presets when one workflow needs a narrower provider or model policy than the workspace default.
Model routing suffixes
Append a routing suffix when the model ID itself should make the optimization mode authoritative for that request:
For example,
openai/gpt-5-mini:nitro uses throughput-first routing. A recognized routing suffix takes precedence over request-level routing.mode or provider.sort, preset and workspace routing modes. Other constraints such as provider allow lists, regional requirements, guardrails, and price ceilings still apply.
How routing works at a high level
- You send a request with a model id.
- The Gateway evaluates provider health, latency, and capability coverage.
- A provider is selected and the request is executed.
Choose an exact provider in the model id
Use<provider-id>:<canonical-model-id> when a request must use one specific provider-model pair:
baseten:google/gemma-4-26b-a4b:free.
Read Provider-qualified model IDs for complete syntax, free-route validation, routing precedence, aliases, error codes, and request examples.
Control routing and fallbacks
The current public fallback and routing controls are intentionally explicit:Presets constrain the fallback pool
In Dashboard -> Settings -> Presets, you can define:- allowed models
- provider allow lists
- provider ignore lists
- default prompt and parameter behavior
Routing mode changes provider ranking
In Dashboard -> Settings -> Routing, workspaces can tune how the Gateway ranks compatible providers:balancedpricelatencythroughput
BYOK fallback is explicit
In Dashboard -> Settings -> BYOK, teams can choose whether a failed BYOK request is allowed to fall back to Phaseo credits. This is the current public control for the common “my own key failed, should the request still complete?” decision.Dynamic routes attach policy to API keys
In Dashboard -> Settings -> Routing, create a dynamic route when different API keys or request classes need different provider behavior. A route can:- branch on nested request-body fields, request headers, custom metadata, endpoint, model, or session ID
- split traffic by percentage for A/B tests and gradual rollouts
- enforce daily, weekly, or monthly request and cost limits using the authenticated key’s usage buckets
- call a different model and choose its routing mode, provider preference, and fallback policy
- enable cache-aware and session-aware provider affinity
- attach to one or more inference API keys
Fallback behavior
If a provider returns errors or rate limits, the Gateway can retry or route to another provider that supports the same model. You should still handle 429 and 5xx responses with exponential backoff. Model nodes in a dynamic route can also define an ordered list of fallback models. Phaseo first exhausts the eligible provider attempts for the selected model. If the resulting response is retryable (429, 500, 502, 503, or
504), the Gateway reruns the complete policy and provider-selection pipeline
for each fallback model in order. Client errors are returned immediately and do
not switch models.
Each fallback is independently checked against workspace model restrictions,
guardrails, provider policy, pricing, and capability support. A route can store
up to eight fallback models.
Read more in:
Cache-aware and session-aware affinity
Cache-aware routing is enabled by default on text generation endpoints. After a provider reports a real prompt-cache read, Phaseo pins matching context back to that provider for 15 minutes, provided the provider remains healthy and allowed by the active route, preset, guardrail, and request policy. Whensession_id is present, the cache affinity is keyed to the session instead
of only the opening context. Session affinity is refreshed when Phaseo observes
another cache read and is retained for up to 24 hours of session activity.
Circuit breakers and policy filters always take precedence over affinity.
Opt out for one request without changing workspace or dynamic-route defaults: