/v1/routing/{policy_id}/previewPreview a routing decision
Return the model the policy would pick for sample text, with the score of every rule. The text is checked like one message of a request, and is not sent to any model in the policy.
Authentication: Bearer API key in the Authorization header
Path parameters
policy_idstringrequiredThe routing policy id.
Request body
inputstringrequiredThe text to check, as it would appear in one message of a request.
Responses
200The decision.
Response
decisionenumrequiredrulewhen a rule matched,defaultwhen none did.modelstringrequiredThe model slug the policy would send the request to.
tagstring | nullrequiredThe tag of the rule that matched.
nullondefault.resultsarray<object>requiredOne entry per rule, in rule order.
results
tagstringrequiredprobabilitynumberrequiredThe probability, from 0 to 1, that the answer to the tag's question is yes.
thresholdnumberrequiredmatchedbooleanrequired
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.
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.
503The check could not run. Retry with backoff.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one.
Request
curl -X POST 'https://api.experientiallabs.ai/v1/routing/00000000-0000-4000-8000-000000000012/preview' \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"input": "Draft the board update. Revenue was 4.2M against a 5M plan and we are pausing the Atlas launch."
}'Response
{
"decision": "rule",
"model": "my-local-model",
"tag": "internalConfidential",
"results": [
{
"tag": "internalConfidential",
"probability": 0.96,
"threshold": 0.5,
"matched": true
},
{
"tag": "personalData",
"probability": 0.02,
"threshold": 0.7,
"matched": false
}
]
}https://api.experientiallabs.ai/v1/routing/00000000-0000-4000-8000-000000000012/preview