Create Routing Policy
Create an organization routing policy. Clients use it by sending its
model (@alias/<slug>) as the model. The organization’s first policy
becomes the default automatically; otherwise send is_default true to make
it the default. 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.
Request
PRIORITY tries priority_order in turn; INTELLIGENT picks among allowed_models per request, optimizing for axis.
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.
INTELLIGENT only. What the router optimizes for: COST, PERFORMANCE or CAPABILITY. Omitted or null means COST.
PRIORITY only. The priority values are kept as sent; responses list the entries sorted by priority. A model listed twice is a 422.
The policy’s model alias, as a lowercase bare name. Omitted: derived from the name, or “default” when the policy becomes the organization default. A taken alias gets a suffix (“fast”, “fast-2”).
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.