v65

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-0794109383.7 KB
routing

Explain Policy

Compile a policy and return the plan, without dispatching anything.

Master-key gated, and deliberately so: the response enumerates the policy's targets, which is exactly the information a policy exists to keep off the wire. It is a management surface, not a caller-facing one.

Accepts an unsaved spec as well as a saved name, so a form can validate what the operator is about to save. The response includes dropped candidates with reasons, which is the part that catches a "failover" policy that has quietly compiled down to a single attempt.

post/v1/routing/policies/explain

Request body

allowed_modelsstring[] nullable

Simulate an API key's allow-list. Omit for unrestricted.

budget_remaining_usdnumber nullable

Simulated budget remaining, USD.

budget_used_pctnumber nullable

Simulated budget usage percentage.

key_idstring nullable

Evaluate conditions as this API key id.

namestring nullable

An existing policy to explain.

specobject nullable

An unsaved policy body to explain.

user_idstring nullable

Evaluate conditions as this user.

Response

Successful Response

guardrailsobject[] required
is_dynamicboolean required
namestring required
router_backendstring nullable
router_candidatesstring[]
selection_reasonstring required