v65

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

Set Policy

Create or update a stored policy, global or scoped to one user.

The spec is validated here and stored as given, so a row can never contain a body this build would refuse at load. The cache is refreshed twice: once before validating (so the shadowing checks see other writers' policies) and once after committing (so this worker serves the new policy immediately).

post/v1/routing/policies

Request body

namestring required

Model name callers send, e.g. 'fast'.

specobject required

The policy body: select (with exactly one default entry, last), optional on_failure and guardrails. Same schema as a routing.policies entry in config.yml, and closed to unknown keys, so a typo is a 400 rather than a silently ignored setting.

user_idstring nullable

User this policy belongs to. Omit for a global policy every caller sees. A user-scoped policy resolves only for that user and shadows a global one of the same name.

Response

Successful Response

created_atstring nullable
is_dynamicboolean
namestring required
sourcestring required
specobject required
updated_atstring nullable
user_idstring nullable