Decisions API
The Decisions API answers typed questions about an input. You send a state (the input to decide on) and a map of questions, and every answer comes back as a typed value with a probability for every option. Nothing is generated, so there is no text to parse and no output format to enforce.
Use it wherever you would otherwise prompt a chat model to “answer yes or no” or “reply with one of these labels”: routing, triage, moderation, judging agent runs, and scoring.
The Decisions API serves Sarvam Prism (sarvam-prism).
The SDK examples need sarvamai 0.1.43 or later for Python (pip install -U "sarvamai>=0.1.43")
and sarvamai 1.1.15 or later for JavaScript (npm install sarvamai@latest).
Make a decision
Use POST /v2/systemone. One request answers every
question in questions, and each answer comes back under the same ID.
Response:
noul is the probability that the answer is yes. output_tokens is always 0.
Question types
Every question has a type. Its criteria define the options, and its answer has a matching shape.
instructions is the question to ask about the state: a string, or an object or array rendered as
JSON. A noul needs instructions, criteria, or both. For choice and score, instructions
is optional but usually makes the question clearer.
Yes/no with criteria
Describe when each answer applies in criteria:
Choice
Write each option’s description as the condition under which it applies. Option IDs come back
verbatim as the keys of probabilities, and the order you list them in does not affect the answer.
Score
List the levels from lowest to highest. The answer keys them "0", "1", … in your order, and
legend maps each key back to your text.
Ask several questions at once
Put every question about the same state in one request. The state is counted once per request, so extra questions add only their own tokens.
Response:
Every answer carries its type, so switching on it narrows the answer to the right shape in the
typed SDKs.
Read the answers
Probabilities can vary slightly between identical requests; the top answer is stable.
Act on confidence
Sarvam Prism’s probabilities are calibrated: an answer given with 90% probability is wrong about 10% of the time or less. Act on confident answers automatically and send the rest to a person.
Set the threshold on the top probability (noul, or probabilities[choice]), not on confidence:
the calibration figures on the Sarvam Prism page
refer to the probability.
Send structured state
state can be a string, an object, or an array. Objects and arrays are rendered as compact JSON,
so you can pass a record as it is.
Parameters
Each question accepts only these keys:
Refused or unsupported on this route
The Decisions API returns probabilities only, so generation settings don’t apply:
temperature,max_tokens,stream, and other generation fields return422.- Images are not supported. An image URL in
imagesreturns400; an inline image returns422. - Any key in a question other than
type,instructions, andcriteriareturns422, including misspellings such asinstruction. - A
choiceoutside 2–255 options or ascoreoutside 2–10 levels returns422.
Limits and billing
- 32,768 tokens per question (state + that question’s instructions and options). If any one
question is over, the whole request fails with
422and names the question. - 60 seconds per request. A longer request fails with
503 model_overloaded; split very large batches of questions across several requests. - Pricing: ₹4 per 1M input tokens and ₹0 per 1M output tokens, on every plan. Check
usage.input_tokensfor the exact count.
Errors return message, code and request_id; validation errors also return param, the path to
the field at fault, such as questions.urgent.noul.instruction. See the
Sarvam Prism page for the error table and the
Decisions API Reference for the complete request and response schemas.