Skip to content
Rapid Router
API reference · Inference

Decisions

POST /decisions: yes/no, multiple-choice and rubric answers with probabilities, up to 1,000 questions per call, billed on input tokens.

POST /decisions answers closed questions about one input: yes or no, one of a set of options, or a level on a rubric. A decision model never writes text. Each question comes back with probabilities and a confidence from 0 to 1, and up to 1,000 questions share one call and one copy of the input. The model is google/gemini-decision-1, listed under the Decisions tab of the catalog. It is not in GET /models, which lists chat models only.

Every question needs a type and instructions. noul is yes or no, and its answer is the probability that the answer is yes. choice takes criteria as an object of option names and their descriptions (2 to 255 options) and returns the winning option and every option's probability. score takes criteria as a list of levels, lowest first, and returns the expected level as a decimal, with a probability per level.

input is a string or a list of content blocks. A block is text, { "type": "text", "text": "..." }, or media sent as base64, for example { "type": "image", "data": "<base64>", "mime_type": "image/png" }. Images, audio, video and PDFs are accepted, up to about 256K input tokens and a 16 MB request. Billing is on input tokens only, since a decision has no output, and usage shows the tokens per modality. A mistake in a question comes back as a 400 that names the field.

curl https://rapidrouter.ai/api/v1/decisions \
  -H "Authorization: Bearer $RAPIDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-decision-1",
    "input": "The parcel arrived with a crushed corner and a torn label.",
    "questions": {
      "is_damaged": { "type": "noul", "instructions": "Is the parcel damaged?" },
      "action": { "type": "choice", "instructions": "What should support do?",
        "criteria": { "refund": "Item is unusable", "replace": "Damaged but replaceable", "nothing": "No real damage" } },
      "severity": { "type": "score", "instructions": "How severe is the damage?",
        "criteria": ["none", "minor", "major"] }
    }
  }'