# Ask for a decision

A decision model answers your questions about the messages with probabilities rather than text, so your code can branch on the answer directly.

`POST https://api.momor.ai/models/decision`

Each route serves one type of model. A chat model reasons and writes; a decision model evaluates your input against the answer types you define and returns calibrated probabilities, never text. Here `auto`, `*`, a tier and a name all reach decision models alone. Chat and decision models follow the two systems of Daniel Kahneman’s *Thinking, Fast and Slow*: a decision model is System One and a chat model System Two, which is why `/models/two` answers as [/models/chat](/docs/gateway/reference/chat/) does.

## Body

The body is the one [Call a model](/docs/gateway/reference/chat/) takes, with `systemPrompt` as an array of questions. A decision takes no `streaming`, `tools` or `responseSchema`.

- `systemPrompt` (Question[], required): The questions, at least one.
  - `name` (string, required): Unique in the request. The answer comes back under it.
  - `type` (string, required): The kind of answer. Values: `boolean`, `choice`, `score`.
  - `instructions` (string, required): What the model is asked.
  - `criteria` (object | string[], required): What each answer means: a boolean explains true and false; a choice gives at least two values, each with what it means; a score lists two to ten levels, lowest first.
- `messages` (Message[], required): What the questions are about. A decision reads the user’s messages only.
- `model` (string | object, default `auto`): Which decision models may answer, as on Call a model.
- `models` ((string | object)[]): Several selectors, tried in order.
- `prioritization` (object): Which providers lead and which serve nothing, zdr, zero data retention, deprecated and maxAge, as on Call a model.
- `keys` (object): Your own provider keys for this call.
- `fileProcessing` (object, default `{ "type": "none" }`): Whether an attached file is converted to text first. Under zero data retention, anything but none is refused with 400.

## Response

- `type` (string): decision
- `model` (object): What served the call: name, tier, publisher and provider.
- `answers` (Answer[]): One per question, in the order asked.
  - `name` (string): The question answered.
  - `type` (string): boolean, choice or score.
  - `refused` (boolean): true where the model declined the question.
  - `probability` (number): For a boolean: the probability that the answer is true.
  - `choice` (string): For a choice: the value chosen.
  - `score` (number): For a score: the probability-weighted level, counted from 0.
  - `confidence` (number): For a choice or a score: how concentrated the probabilities are. Absent where the model reports none.
  - `probabilities` (object): For a choice, by value; for a score, by level index.
- `usage` (object): The provider and the tokens it counted.

## Errors

Failures are problem documents, as on [Call a model](/docs/gateway/reference/chat/#errors). The messages particular to a decision:

| Status | Code | What happened |
| --- | --- | --- |
| `400` | `—` | A decision carries its questions as systemPrompt, an array of at least one question. |
| `400` | `—` | A decision takes no stream, tools or responseSchema. |
| `400` | `—` | Every question needs a name of its own. |
| `400` | `—` | Question <name> needs instructions. |
| `400` | `—` | Question <name>’s criteria do not fit a <type>. |
| `400` | `—` | The provider’s: <model> decides on user messages alone, on text alone, or on text and inline images alone. |
| `400` | `—` | The provider’s: <model> takes at most <count> options or choices a question. |
| `404` | `—` | No decision model answers to the name. A chat model’s name sent here is not found. |
| `502` | `—` | <model> answered <question> with a letter that is not one of its options. Safe to retry. |

```bash title="Request"
curl https://api.momor.ai/models/decision \
  -H "Authorization: Bearer $MOMOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "systemPrompt": [
      { "name": "is_bug", "type": "boolean", "instructions": "Is the customer reporting a defect?",
        "criteria": { "true": "Broken or unexpected behaviour.", "false": "A question or a feature request." } },
      { "name": "team", "type": "choice", "instructions": "Which team owns this ticket?",
        "criteria": { "payments": "Checkout and billing.", "frontend": "Rendering and layout." } },
      { "name": "urgency", "type": "score", "instructions": "How urgent is this?",
        "criteria": ["Can wait for the next release", "Fix this week", "Blocking revenue now"] }
    ],
    "messages": [{ "type": "user", "value": "My checkout page shows a blank screen after I click Pay." }]
  }'
```

```python
import os
import requests

decision = requests.post(
    "https://api.momor.ai/models/decision",
    headers={"Authorization": f"Bearer {os.environ['MOMOR_API_KEY']}"},
    json={
        "model": "gpt-6-luna",
        "systemPrompt": [
            {"name": "is_bug", "type": "boolean", "instructions": "Is the customer reporting a defect?",
             "criteria": {"true": "Broken or unexpected behaviour.", "false": "A question or a feature request."}},
        ],
        "messages": [{"type": "user", "value": "My checkout page shows a blank screen after I click Pay."}],
    },
).json()
print(decision["answers"][0]["probability"])
```

```json title="Response"
{
  "type": "decision",
  "model": { "name": "gpt-6-luna", "tier": "medium", "publisher": "OpenAI", "provider": "OpenAI" },
  "answers": [
    { "name": "is_bug", "type": "boolean", "refused": false, "probability": 0.96, "probabilities": {} },
    { "name": "team", "type": "choice", "refused": false, "choice": "payments", "confidence": 0.75,
      "probabilities": { "payments": 0.84, "frontend": 0.16 } },
    { "name": "urgency", "type": "score", "refused": false, "score": 1.99, "confidence": 0.99,
      "probabilities": { "0": 0, "1": 0.01, "2": 0.99 } }
  ],
  "usage": { "provider": "openai", "inputTokens": 476, "outputTokens": 0 }
}
```
