/v1/routingCreate a routing policy
Send alias as the model of an inference request to use the policy. Rules are tried in order and the first match serves the request. default_model serves a request only when the whole request was read and no rule matched. Every model must be one your organization can call; another routing policy or an uncensored model answers 422 model_not_allowed. An alias that is already a model or an alias of your organization answers 409 alias_unavailable.
Authentication: Bearer API key in the Authorization header
Request body
aliasstringrequiredThe model name callers send to use the policy.
descriptionstring | nullA note for people.
rulesarray<object>requiredTried in order. The first rule that matches picks the model.
rules
tagstringrequiredA tag id from
GET /v1/tags.thresholdnumberThe rule matches when the tag's probability for any message in the request is at or above this value.
modelstringrequiredThe model slug that serves the request when the rule matches.
default_modelstringrequiredThe model slug that serves a request when the whole request was read and no rule matched.
fallback_modelstring | nullThe model slug that serves a request when the check does not finish in time, or the request carries content it cannot read.
nullrefuses the request instead:503 gateway_unavailablewhen the check did not finish,400 content_filterfor content it cannot read.max_wait_msintegerThe longest a request waits for the check, in milliseconds.
Responses
201The created routing policy.
Response
idstringrequiredaliasstringrequiredThe model name callers send to use the policy.
descriptionstring | nullA note for people.
rulesarray<object>requiredTried in order. The first rule that matches picks the model.
rules
tagstringrequiredA tag id from
GET /v1/tags.thresholdnumberThe rule matches when the tag's probability for any message in the request is at or above this value.
modelstringrequiredThe model slug that serves the request when the rule matches.
default_modelstringrequiredThe model slug that serves a request when the whole request was read and no rule matched.
fallback_modelstring | nullrequiredThe model slug that serves a request when the check does not finish in time, or the request carries content it cannot read.
nullrefuses the request instead:503 gateway_unavailablewhen the check did not finish,400 content_filterfor content it cannot read.max_wait_msintegerrequiredThe longest a request waits for the check, in milliseconds.
created_atstringupdated_atstring
401Missing, unknown or revoked API key.
403The key is not a provisioning key, or the resource is read-only (
tag_read_only,guardrail_read_only).Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one.
404The resource does not exist or belongs to another organization. An organization without access gets this answer on every route.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one.
409The alias is already a model or an alias your organization can call (
alias_unavailable).Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one.
422The body failed validation, or it names something that does not exist or cannot be used (
unknown_tag,unknown_model,unknown_identity,model_not_allowed).Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one.
Request
curl -X POST 'https://api.experientiallabs.ai/v1/routing' \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"alias": "acme-auto",
"description": "Keep confidential requests on our own model",
"rules": [
{
"tag": "internalConfidential",
"threshold": 0.5,
"model": "my-local-model"
},
{
"tag": "personalData",
"threshold": 0.7,
"model": "my-local-model"
}
],
"default_model": "gpt-6-luna",
"fallback_model": "my-local-model"
}'Response
{
"id": "00000000-0000-4000-8000-000000000012",
"alias": "acme-auto",
"description": "Keep confidential requests on our own model",
"rules": [
{
"tag": "internalConfidential",
"threshold": 0.5,
"model": "my-local-model"
},
{
"tag": "personalData",
"threshold": 0.7,
"model": "my-local-model"
}
],
"default_model": "gpt-6-luna",
"fallback_model": "my-local-model",
"max_wait_ms": 2000,
"created_at": "2026-11-20T00:00:00Z",
"updated_at": "2026-11-20T00:00:00Z"
}https://api.experientiallabs.ai/v1/routing