Routing policies control which AI provider and model handles each request. Instead of hardcoding a single provider, policies automatically select the best option based on your optimization goals, whether that’s minimizing cost, maximizing uptime, or balancing both with ML-powered routing.
For details on how a policy gets applied to a specific request and how to use default_routing, see Using routing policies.
The project’s policy picks the provider and model. No model field is needed.
With no project_id, the same request falls back to the org default routing policy.
Policies are created in the dashboard. These JSON bodies describe the policy configuration itself. They are never sent in a POST /responses request.
You can attach tags to requests (user tier, region, environment, and so on) and use them to route to different policies. Rules are evaluated in priority order: the first matching rule applies, and unmatched requests fall through to the default strategy.
Conditions support AND/OR logic and operators like eq, gt, in, contains, starts_with, and exists. Configure tag-based routing through the dashboard.
They are policy definitions, the configuration used when creating a routing policy in the dashboard. They are not request-body fields for POST /responses.
The complexity scoring step adds ~1-4ms. Negligible compared to LLM inference time.
Clean separation below 0.4 (simple) and above 0.6 (complex). Edge cases around 0.5 route conservatively to more capable models.
Gateway falls back to the most capable model in your policy. Quality is never compromised by a scorer failure.
Yes. New models work immediately, with capabilities inferred from pricing data.
The router only selects from models in your policy, never outside of it