HridaSpro Docs

Api Reference

Decisions API

Ask yes or no, multiple choice, and scoring questions about an input and get back probabilities.

API console
POST/v1/decisions
Bash
curl https://spro.hridaai.com/v1/decisions \  -H "Content-Type: application/json" \  -H "Authorization: Bearer spro-xxxxxxxxxxxxxxxx" \  -d '{    "model": "gpt-6-luna-decisions",    "input": "My order arrived broken and nobody is answering my emails.",    "questions": [      {        "type": "predicate",        "name": "is_complaint",        "instructions": "The customer is making a complaint."      },      {        "type": "choice",        "name": "team",        "instructions": "Which team should handle this message?",        "choices": [          { "value": "billing" },          { "value": "shipping", "description": "Damaged or late orders" },          { "value": "general" }        ]      },      {        "type": "score",        "name": "urgency",        "instructions": "How urgent is this message?",        "levels": [          { "label": "low" },          { "label": "medium" },          { "label": "high" }        ]      }    ]  }'
JSON
{  "answers": [    {      "type": "predicate",      "name": "is_complaint",      "probability": 0.97    },    {      "type": "choice",      "name": "team",      "choice": "shipping",      "confidence": 0.91,      "probabilities": [        { "value": "shipping", "probability": 0.91 },        { "value": "general", "probability": 0.07 },        { "value": "billing", "probability": 0.02 }      ]    }  ],  "model": "gpt-6-luna-decisions",  "usage": {    "input_tokens": 142,    "input_tokens_details": { "cache_write_tokens": 0, "cached_tokens": 0 },    "output_tokens": 18,    "output_tokens_details": { "reasoning_tokens": 0 },    "total_tokens": 160  }}

POST https://spro.hridaai.com/v1/decisions

Answers classification and scoring questions about an input. You send some content and a list of questions, and get one answer per question, in the order you asked. Answers are probabilities and labels, not generated text, so this is useful for moderation, routing, triage and scoring. OpenAI-compatible, so you can use the OpenAI SDK with the Spro base URL. Non-streaming only.

Only models built for decisions are served, such as gpt-6-luna-decisions and gemini-decision-1. Other models return 400 with the code unsupported_api_surface.

Request body

ParameterTypeRequiredDescription
modelstringRequiredA model that supports decisions.
inputstring or arrayRequiredThe content to judge. A plain string, or an ordered array of messages (user, developer, system, assistant), function calls and their outputs, or custom tool calls and their outputs. Every question is answered against this same input.
questionsarrayRequiredThe questions to ask, up to 400. Each one is a predicate, choice or score question (see below). Answers come back in the same order.
prompt_cache_keystringOptionalGroups requests so the provider can reuse its prompt cache.
safety_identifierstringOptionalA stable identifier for your end user, to help with abuse detection. Do not send personal details.

The models fallback list is not supported for decisions, because each decision model is served by specific providers. Sending it returns 400. Sampling parameters (temperature, top_p, penalties) are not accepted and are removed before the upstream call.

Question types

Every question has a type, instructions (what to decide) and an optional name. Give each question a name so you can match answers to questions.

TypeExtra fieldsWhat you get back
predicatenoneThe probability that a statement about the input is true.
choicechoices: 2 to 255 unique options, each { "value": string or boolean, "description": optional string }The chosen value, a confidence, and a probability for every option.
scorelevels: an ordered list of { "label": string, "description": optional string }A score, a confidence, and a probability for each level.

The decision object

FieldTypeDescription
answersarrayOne answer per question, in the order asked.
modelstringThe model that answered.
usageobjectToken counts: input_tokens, output_tokens, total_tokens, and details for cached and reasoning tokens.

Each answer has a type and the question's name (null if the question had none):

typeFields
predicateprobability, a number from 0 to 1.
choicechoice, confidence, and probabilities, a list of { value, probability }.
scorescore, confidence, and probabilities, a list of { label, probability, value }.
refusalThe model declined this question. The other questions in the request can still be answered.

Using Google Gemini decision models

Spro accepts the same request body for every decision model. With a Gemini model, predicate questions (yes or no) are converted for Google and the answers are converted back, so the reply has the shape shown above.

  • Other question types, choice and score, are not converted. To use them with Gemini, send Google's own request format, and you get Google's reply back unchanged.
  • In the converted format, question names must be 1 to 64 characters of letters, digits, _ or -, and each name can be used only once. Otherwise the request fails with 400.

Guardrails

Input guardrails scan the text in input, one text field at a time: message text, function and custom tool outputs, and JSON parts. Images are not scanned. The instructions in your questions are written by you, not your end users, so they are not scanned. The answers are probabilities and labels, not generated text, so the output pass logs usage only. A blocked input returns 403 Forbidden:

JSON
{  "error": {    "message": "Request blocked by guardrail: sensitive_information_disclosure",    "type": "guardrail_block",    "code": "GUARDRAIL_BLOCKED"  }}