- Put a benchmark in production: each call goes to the model that did best on similar calls (how it works).
- Apply the prompt caching your benchmark recommends, and choose when a call may leave the model that has its prompt in cache.
- Call your own models in a fixed order, each at the reasoning effort you set, even without a benchmark.
- Route some customers differently: by name, or by their cost or margin.
- Define the fallback and retry strategy when a model fails or is unhealthy.
- In the dashboard: Create a strategy.
- With the management API (the endpoint is also accessible with the MCP server).
- With your AI agent, using the Create a routing strategy from a benchmark skill.
Create a strategy
Start from a finished benchmark or from scratch.- Global routing rule: what every call follows.
- Dynamic routing picks, for each call, the model and reasoning effort that did best on the most similar calls of your benchmark, for your optimization objective, among the models you select (how it works).
- Fixed order tries your models in the order you set, each at the reasoning effort you set. It is the only option without a benchmark.
- Prompt caching (from a benchmark): apply the caching the benchmark recommends for each model, and choose when a call may leave a model that already has its prompt cached. A note asks you to keep sending your app’s cache breakpoints when that caching uses them. See Prompt caching.
- Routing overrides: exceptions to the global rule, checked first, each with its own rule and models: for the customers you list, or for customers whose cost or margin is above or below a threshold. The first that matches wins. They need
weflayr.customer_nameon each call. - Reliability: self-heal, on by default (set
self_healto false in the strategy’s JSON to turn it off), and when to retry a model or fall back to the next one. A call can override them with its own gateway fields.
Use it in your code
Copy the strategy’s id from its page and send it as the model:strategy/<slug> follows the latest version. Pin one with strategy/<slug>:<version>. List models with your API key lists your strategies and their versions.
What your call sends wins
The strategy fills in what your call leaves out. A setting your call sends itself is kept:
The model,
provider and region are the strategy’s own: a call through a strategy that sends provider or region gets a 400.