> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Decisions

> Get typed judgments (probability, choice, or score) from models through the Prisma AIRS AI Gateway's /v1/decisions endpoint.

The Decisions API returns a **typed judgment** instead of generated text. You send a `state` and a set of `questions`. The model returns one typed answer for each question.

Use it for classification, routing, scoring, and yes/no checks, where you need a structured answer and not free text.

> [!NOTE]
>
> `/v1/decisions` is currently available through [TypeSafe's Jev models](https://docs.portkey.ai/docs/aigw/integrations/llms/typesafe.md), directly or via [OpenRouter](https://docs.portkey.ai/docs/aigw/integrations/llms/openrouter.md). It does not support streaming.

## Quick Start

```sh cURL theme={"system"}
curl https://aigw.portkey.ai/v1/decisions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PORTKEY_API_KEY" \
  -H "x-portkey-provider: typesafe" \
  -d '{
    "model": "jev-latest",
    "state": "Help! My payouts have been failing for 3 days.",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": { "billing": "Payments", "technical": "Bugs" }
      }
    }
  }'
```

Response:

```json theme={"system"}
{
  "model": "jev-1.13.0",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "probabilities": { "billing": 0.88, "technical": 0.12 },
      "confidence": 0.81
    }
  },
  "usage": { "input_tokens": 296, "output_tokens": 20 },
  "provider": "typesafe"
}
```

## Question Types

Each entry in `questions` sets a `type`. The type sets the shape of the answer:

| Type | Use for | Answer shape |
| :- | :- | :- |
| `noul` | A yes/no judgment | `{ noul: <0–1 probability> }` |
| `choice` | One label from a fixed set | `{ choice, probabilities, confidence }` |
| `score` | A position on a scale | `{ score, legend, probabilities, confidence }` |

`criteria` gives the type-specific detail. For a `choice` question, it is the set of labels.

## Gateway Features

Decisions requests go through the same gateway as other endpoints:

* **Routing** — Retries, fallbacks, load balancing, and circuit breaking through [Configs](https://docs.portkey.ai/docs/aigw/product/ai-gateway/configs.md)
* **Caching** — [Simple and semantic caching](https://docs.portkey.ai/docs/aigw/product/ai-gateway/cache-simple-and-semantic.md)
* **Guardrails** — Before-request checks on the `state` field only. See [Guardrails for Decisions](https://docs.portkey.ai/docs/aigw/product/guardrails/decisions-guardrails.md)
* **Observability** — Logs, cost tracking, and analytics in [Observability](https://docs.portkey.ai/docs/aigw/product/observability.md)

## API Reference

* [Create a Decision](https://docs.portkey.ai/docs/aigw/api-reference/decisions/create-decisions.md) -- `POST /v1/decisions`

> **[TypeSafe](https://docs.portkey.ai/docs/aigw/integrations/llms/typesafe.md)**
>
> Provider setup and pricing

> **[API Reference](https://docs.portkey.ai/docs/aigw/api-reference/decisions/create-decisions.md)**
>
> Decisions API reference

> **[Universal API](https://docs.portkey.ai/docs/aigw/product/ai-gateway/universal-api.md)**
>
> All API formats

> **[Guardrails for Decisions](https://docs.portkey.ai/docs/aigw/product/guardrails/decisions-guardrails.md)**
>
> Scan `state` before it reaches the model


## Related topics

- [Create decisions](https://docs.portkey.ai/docs/aigw/api-reference/decisions/create-decisions.md)
- [Guardrails for Decisions Requests](https://docs.portkey.ai/docs/aigw/product/guardrails/decisions-guardrails.md)
- [Request Parameters Check](https://docs.portkey.ai/docs/aigw/integrations/guardrails/request-parameters-check.md)
- [TypeSafe (Jev)](https://docs.portkey.ai/docs/aigw/integrations/llms/typesafe.md)
- [Supported Endpoints & Capabilities](https://docs.portkey.ai/docs/aigw/product/guardrails/capabilities.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.