Skip to navigation

Decide (Sarvam Prism)

View as Markdown

Answers a set of typed questions about one input and returns a calibrated probability for every allowed option. The model does not generate text, so there is nothing to parse. The order of choice options does not affect the answer.

Requires api-subscription-key, or Authorization: Bearer <key>.

Question types: noul (yes/no), choice (one of your options) and score (a level on your ordered scale).

Repeatability: probabilities can vary slightly between identical requests; the top answer is stable.

Not supported: images and streaming. Generation fields such as temperature, max_tokens, stream and images are refused: image URLs return 400, and the others return 422. Unknown keys inside a question also return 422.

Limits: 32,768 tokens per question (state + question + options), 2–255 options per choice and 2–10 levels per score. There is no cap on the number of questions. The state is not truncated, and if any one question breaks a limit the whole request fails with 422.

Timeout: each request must finish within 60 seconds. A longer request fails with 503 model_overloaded; split very large batches across several requests before retrying.

Errors: every error carries a message, a code and a request_id. Validation errors also carry param, the path to the field at fault, such as questions.urgent.noul.instruction.

Authentication

api-subscription-keystring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
modelstringRequired

The decision model to use. Currently sarvam-prism (Sarvam Prism).

statestring or map from strings to any or list of anyRequired

The input to decide on: text, or an object or array that is rendered as compact JSON. Required; an empty string is allowed. It is never truncated: if any one question (state + question + options) exceeds 32,768 tokens the request fails with 422.

questionsmap from strings to objectsRequired
Map of your question ID to a question, at least one. There is no cap on the number of questions. Every question is answered in one call, and the answer uses the same ID.

Response

Successful Response
modelstring
answersmap from strings to objects
One answer per question, keyed by your question ID.
usageobject

Errors

400
Bad Request Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error