> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Decisions

A decision call sends a state to evaluate and a set of named questions. The model returns one typed answer for each question, so your agent reads a probability, an option, or a score instead of parsing free text. Decisions use the [`jev-1-13-0` model](/ai-gateway/models#decision-models).

## Make a request

Send `POST ${ASTRO_GATEWAY_URL}/v1/decisions` with `ASTRO_GATEWAY_API_KEY` as a bearer token. The OpenAI SDKs have no decisions method, so use a plain HTTP client.

**`curl`**

```bash title="curl"
curl "$ASTRO_GATEWAY_URL/v1/decisions" \
  -H "Authorization: Bearer $ASTRO_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-1-13-0",
    "state": "A customer asked for a refund 3 days after buying a jacket. The policy allows refunds within 30 days.",
    "questions": {
      "eligible": {
        "kind": "noul",
        "instructions": "Is the customer eligible for a refund?"
      },
      "action": {
        "kind": "choice",
        "instructions": "What should the agent do next?",
        "criteria": {
          "approve": "Issue the refund",
          "escalate": "Hand off to a human"
        }
      },
      "tone": {
        "kind": "score",
        "instructions": "How upset is the customer?",
        "criteria": ["Calm", "Frustrated", "Angry"]
      }
    }
  }'
```

**`Python`**

```python title="Python"
import os
import requests

response = requests.post(
    f"{os.environ['ASTRO_GATEWAY_URL']}/v1/decisions",
    headers={"Authorization": f"Bearer {os.environ['ASTRO_GATEWAY_API_KEY']}"},
    json={
        "model": "jev-1-13-0",
        "state": "A customer asked for a refund 3 days after buying a jacket. The policy allows refunds within 30 days.",
        "questions": {
            "eligible": {
                "kind": "noul",
                "instructions": "Is the customer eligible for a refund?",
            },
        },
    },
)
response.raise_for_status()
print(response.json()["answers"]["eligible"]["value"])
```

**`TypeScript`**

```typescript title="TypeScript"
const response = await fetch(`${process.env.ASTRO_GATEWAY_URL}/v1/decisions`, {
    method: "POST",
    headers: {
        Authorization: `Bearer ${process.env.ASTRO_GATEWAY_API_KEY}`,
        "Content-Type": "application/json",
    },
    body: JSON.stringify({
        model: "jev-1-13-0",
        state: "A customer asked for a refund 3 days after buying a jacket. The policy allows refunds within 30 days.",
        questions: {
            eligible: {
                kind: "noul",
                instructions: "Is the customer eligible for a refund?",
            },
        },
    }),
});
const { answers } = await response.json();
console.log(answers.eligible.value);
```

## Request fields

| Field       | Type             | Description                                                        |
| ----------- | ---------------- | ------------------------------------------------------------------ |
| `model`     | string           | `jev-1-13-0`.                                                      |
| `state`     | string or object | The situation to evaluate. Pass prose or a JSON object. Required.  |
| `questions` | object           | Named questions. Each key is the name its answer comes back under. |

Each question takes a `kind`, `instructions`, and, for some kinds, `criteria`:

| `kind`   | Asks                            | `criteria`                                                       |
| -------- | ------------------------------- | ---------------------------------------------------------------- |
| `noul`   | A yes-or-no question            | Not used                                                         |
| `choice` | Which one option applies        | Required. An object that maps each option name to a description. |
| `score`  | Where the state sits on a scale | Required. An array of level descriptions, lowest first.          |

## Response

The response carries `answers`, keyed by the question names you sent:

```json
{
  "model": "jev-1.13.0",
  "answers": {
    "eligible": { "kind": "noul", "value": 0.95 },
    "action": {
      "kind": "choice",
      "value": "approve",
      "confidence": 1,
      "probabilities": { "approve": 1, "escalate": 0 }
    },
    "tone": {
      "kind": "score",
      "value": 0.02,
      "confidence": 0.97,
      "probabilities": { "0": 0.98, "1": 0.02, "2": 0 },
      "legend": { "0": "Calm", "1": "Frustrated", "2": "Angry" }
    }
  },
  "usage": { "prompt_tokens": 395, "completion_tokens": 63, "total_tokens": 458 }
}
```

* **`noul`:** `value` is the probability that the answer is yes, from 0 to 1.
* **`choice`:** `value` is the chosen option name. `probabilities` gives the weight of every option.
* **`score`:** `value` is the expected level, where 0 is the first `criteria` entry. `legend` maps each level back to its description.

> **Note**
>
> An agent deployed before decision models launched can't call them yet. The gateway rejects its key because the key doesn't allow the provider. Redeploy the agent to get a key that allows decisions.

## Errors

A malformed question returns `400` with a message that names the question and the problem, such as a `choice` question with no `criteria`. Chat, embeddings, and the Responses API return an error for decision models. See [Errors and limits](/ai-gateway/limits) for status codes the whole gateway shares.

## Next steps

* [Supported models](/ai-gateway/models): every model id the gateway accepts
* [Chat completions](/ai-gateway/chat): call a chat model