Decisions
https://api.oneinfer.ai/v1/ula/decisionsRun structured decisions over arbitrary state and return typed Noul, Choice, and Score answers in a single request. Decision models come from TypeSafe, Respan, Upstage, Together, Cloudflare and Nace.AI; name the model and OneInfer picks the provider. Each question in the request can be one of three types — mix them freely per call.
Request headers
AuthorizationstringrequiredBearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.Content-TypestringrequiredRequest parameters
modelstringrequiredtypesafe/jev-1.13. Use the GET Models endpoint to enumerate available decision models.stateobjectrequiredquestionsobjectrequiredtype discriminator of noul, choice, or score (see Question Types below). Names must be non-empty strings.providerobject{"allow_fallbacks": true}), for TypeSafe, Respan and Upstage models only. Together's, Cloudflare's and Nace.AI's decision models refuse it with a 400.session_idstringtraceobject{"trace_id": "..."}), for TypeSafe, Respan and Upstage models only; the other decision models refuse it with a 400.userstringQuestion types
noulboolean confidenceReturns a probability between 0 and 1 in the answer's noul field. Criteria must define exactly the keys true and false, each describing the matching label.
"is_bug": {
"type": "noul",
"instructions": "Is this a bug?",
"criteria": {
"true": "Broken behavior",
"false": "Not broken"
}
}choicesingle labelReturns the chosen key in the answer's choice field. Criteria is a map of key → label with at least two entries; every name and label must be non-empty.
"team": {
"type": "choice",
"instructions": "Who owns it?",
"criteria": {
"payments": "Payment issue",
"frontend": "Rendering issue"
}
}scorerankReturns the index of the selected option in the answer's score field. criteria is an ordered array of two or more non-empty labels; lower index = ranked higher.
"urgency": {
"type": "score",
"instructions": "How urgent?",
"criteria": ["Can wait", "Blocking revenue"]
}Example request
{
"model": "typesafe/jev-1.13",
"state": { "ticket": "Checkout is broken" },
"questions": {
"is_bug": {
"type": "noul",
"instructions": "Is this a bug?",
"criteria": { "true": "Broken behavior", "false": "Not broken" }
},
"team": {
"type": "choice",
"instructions": "Who owns it?",
"criteria": { "payments": "Payment issue", "frontend": "Rendering issue" }
},
"urgency": {
"type": "score",
"instructions": "How urgent?",
"criteria": ["Can wait", "Blocking revenue"]
}
},
"provider": { "allow_fallbacks": true },
"session_id": "triage-2024-q4",
"user": "support-bot"
}Response
{
"api_details": {
"api_status": "success",
"api_message": "API has returned response successfully."
},
"data": {
"id": "dec_abc123",
"model": "typesafe/jev-1.13",
"provider": "TypeSafe",
"answers": {
"is_bug": { "type": "noul", "noul": 0.96 },
"team": { "type": "choice", "choice": "payments" },
"urgency": { "type": "score", "score": 1 }
},
"usage": {
"input_tokens": 476,
"output_tokens": 70,
"cost": 0.000019992,
"credits_used": 0.0019992
},
"latency_ms": 1820
},
"error": {}
}Error status codes
| Code | Status | Description |
|---|---|---|
200 | OK | Decisions returned successfully. |
400 | Bad Request | Invalid request body, unknown question type, or missing pricing for the chosen model. |
401 | Unauthorized | Missing or invalid Authorization header / Bearer token. |
403 | Forbidden | Insufficient credit balance. |
422 | Unprocessable Entity | Request body failed schema validation. |
429 | Too Many Requests | Upstream provider rate limit reached. |
500 | Internal Server Error | Unexpected error during decision processing. |
503 | Service Unavailable | Decision model is temporarily unavailable. |
504 | Gateway Timeout | Upstream provider timed out. |