Update Routing Policy
Update the fields you send. The policy is updated in place, so its id
stays the same. To change the routing, send strategy with its fields.
Needs a management key.
Authentication
A management key (mgmt_...), sent as Authorization: Bearer <key>. Reading /v1/routing-policies also accepts the organization’s gateway API keys; writing there needs a management key.
Path parameters
The policy’s id.
Request
INTELLIGENT only, optional. Not stored: responses rebuild it from allowed_models. If sent non-empty, it must name the same providers as allowed_models (order and repeats don’t matter), or the request fails with 422. Checked only when strategy is sent.
INTELLIGENT only. What the router optimizes for: COST, PERFORMANCE or CAPABILITY. Omitted or null means COST. Used only when strategy is sent.
true or false turns this policy’s Claude-only setting for Claude Code, Claude Desktop and the Claude Agent SDK on or off. Omitted or null keeps the current value. An organization or project that has it on still applies.
The id of a classifier from /v1/classifiers. An INTELLIGENT policy then judges how complex each request is with your classifier instead of the built-in scorer. An unknown classifier, or one without 3 examples on each side, is a 400. INTELLIGENT only. Send "" to stop using one. null keeps the current value; changing only the strategy keeps it too.
INTELLIGENT only. SAVE_COST, BALANCED or PREFER_SPEED. Omitted or null keeps the current preset.
PRIORITY only. The priority values are kept as sent; responses list the entries sorted by priority. A model listed twice is a 422. Used only when strategy is sent.
Send with its fields to replace the routing. Omitted or null leaves the routing as it is, and allowed_providers, allowed_models, priority_order and axis are ignored.
Vendor tiers for this policy’s requests, replacing the organization’s. Same shape and rules as the organization’s vendor_priority. Omitted or null keeps; {"tiers": []} clears.
Response
INTELLIGENT only. The providers of allowed_models, sorted. Always rebuilt from allowed_models; never stored.
INTELLIGENT only, else null. What the router optimizes for: COST, PERFORMANCE or CAPABILITY.
The ready-to-send model string for this policy, like “@alias/fast-experiment”. Send it as the model in any gateway request to route with this policy.
The policy’s model alias as a bare name, like “fast-experiment”. Null only when no alias could be made, such as an organization at its alias limit.
PRIORITY tries priority_order in turn; INTELLIGENT picks among allowed_models per request, optimizing for axis.
The id of a classifier from /v1/classifiers. An INTELLIGENT policy then judges how complex each request is with your classifier instead of the built-in scorer. An unknown classifier, or one without 3 examples on each side, is a 400. null when the policy uses the built-in scorer.
INTELLIGENT only. How the router trades cost for speed: SAVE_COST, BALANCED or PREFER_SPEED.