Your first decision
A request with all three question types, and how to read each answer.
One request can carry many questions. The model reads the state once and answers each question from it, so extra questions cost very little.
curl https://api.sieve.one/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sieve-latest",
"state": {
"subject": "Charged twice this month",
"body": "Hi, I see two charges of $49 on my card for August. I only have one account. Please fix this ASAP, I am pretty frustrated."
},
"questions": {
"is_billing": { "type": "noul", "instructions": "Is this ticket about billing?" },
"sentiment": {
"type": "choice",
"instructions": "What is the customer'"'"'s tone?",
"criteria": { "calm": null, "frustrated": null, "angry": null }
},
"urgency": {
"type": "score",
"instructions": "How urgent is this ticket?",
"criteria": ["can wait", "this week", "today", "right now"]
}
}
}'Reading the answers
| Question | Answer fields | How to read it |
|---|---|---|
noul (yes/no) | noul | The probability of yes, 0 to 1. Near 0.5 means unsure. No confidence field. |
choice | choice, confidence, probabilities | The winning option, how sure the model is, and one probability per option. |
score | score, confidence, legend, probabilities | The expected level (it can fall between levels), plus legend mapping each level index to your label. |
All numbers are rounded to 2 decimal places. Probabilities sum to 1.
Good habits
- Put everything that is the same across questions in
stateand the specific ask in each question'sinstructions. You pay for the state once. - Send
criteriadescriptions forchoiceandscorewhen the labels alone are ambiguous. - Use confidence to send doubtful answers to review.
- Retry safely with an
Idempotency-Keyheader. See Errors.
Next steps
Question types
The three question types for decisions (yes/no, choice, score) and what each returns.
Confidence
What the confidence values mean, how they are computed, and how to use them to route uncertain answers to review.
Route uncertain answers to review
Act on confident answers automatically and send the doubtful ones to a person, using confidence for choice and score questions and the probability for yes/no.
Errors
Every status code the decision API returns, with the exact response bodies, headers and retry guidance.
Last updated