Decision Models (System One)
Decision models evaluate a set of questions against a shared state, returning boolean probabilities, choices, or scale scores. Use them for classification, assessment, and scoring. Responses are non-streaming JSON.
Endpoints and authentication
| Operation | Method and path |
|---|---|
| Decision request | POST /v1/systemone |
| Available decision models | GET /v1/models?output_modalities=decision |
| TypeSafe SDK compatible request | POST /typesafe/v1/systemone |
| TypeSafe format model list | GET /typesafe/v1/models |
BASE_URL="https://api.ope.ai"
API_KEY="YOUR_API_KEY"
curl "$BASE_URL/v1/models?output_modalities=decision" \
-H "Authorization: Bearer $API_KEY"
Examples use jev. Replace it with an actual model ID from the current available list. Call decision models through the systemone endpoint.
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Non-empty decision model ID |
state | string / object / array | Yes | Text or JSON content evaluated by all questions |
questions | object | Yes | At least one entry; keys are custom question names and values are question definitions |
questions.<name>.type | string | Yes | noul, choice, or score |
questions.<name>.instructions | string / object / array / null | No | Instructions for the question |
questions.<name>.criteria | object / array | Depends on type | See below |
| Question type | criteria | Answer fields |
|---|---|---|
noul | Optional object, such as {"true":"Condition met","false":"Condition not met"} | noul: probability of true, from 0 to 1 |
choice | Required object: option name → description | choice: selected option; confidence, probabilities |
score | Required non-empty ordered array; indices are scale values | score: weighted value; confidence, legend, probabilities |
curl: three question types in one request
curl "$BASE_URL/v1/systemone" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "jev",
"state": "My payments have been failing for three days. Please resolve this immediately!",
"questions": {
"is_urgent": {"type": "noul", "instructions": "Does the customer convey urgency?"},
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {"billing": "Payments, invoicing, refunds", "technical": "Outages, APIs, system problems"}
},
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}'
Example HTTP 200 response (probabilities and scores are illustrative):
{
"model": "jev-1.13.0",
"answers": {
"is_urgent": {"type": "noul", "noul": 0.95},
"department": {
"type": "choice",
"choice": "billing",
"confidence": 0.8,
"probabilities": {"billing": 0.87, "technical": 0.13}
},
"frustration": {
"type": "score",
"score": 1.04,
"confidence": 0.94,
"legend": {"0": "Calm", "1": "Frustrated", "2": "Very angry"},
"probabilities": {"0": 0, "1": 0.96, "2": 0.04}
}
},
"usage": {"input_tokens": 426, "output_tokens": 73}
}
Keys in answers match questions, and each answer's type matches its question. model is the actual version that answered and may differ from the requested ID. usage.input_tokens and usage.output_tokens report input and output token counts.
score can be fractional. legend and probabilities use string indices for scale levels. Interpret probabilities and scores according to your use case; example values are not fixed results.
TypeSafe SDK connection
Set the TypeSafe SDK baseURL to https://api.ope.ai/typesafe and apiKey to your platform API Key. The SDK endpoint uses the same request and response structure.
export TYPESAFE_BASE_URL="https://api.ope.ai/typesafe"
export TYPESAFE_API_KEY="YOUR_API_KEY"
Errors
Errors use detail. Invalid request structure usually returns HTTP 422, with loc identifying the field:
{
"detail": [{
"loc": ["body", "questions", "frustration", "score", "criteria"],
"msg": "Field required",
"type": "missing"
}]
}
Common statuses: 402 insufficient quota, 403 permission or content restriction, 404 unavailable model or incorrect model type, 422 invalid structure or parameters, 429 rate limit, and 503 temporarily unavailable service. Other errors may have a string detail with optional type and code fields.