> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-vrushank-v-draft-oct-1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Decisions

> Get typed judgments (probability, choice, or score) from models through Portkey's /v1/decisions endpoint.

<Info>
  Available on all Portkey [plans](https://portkey.ai/pricing).
</Info>

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](/integrations/llms/typesafe). It does not support streaming.
</Note>

## Quick Start

```sh cURL theme={"system"}
curl https://api.portkey.ai/v1/decisions \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: $PORTKEY_API_KEY" \
  -H "x-portkey-provider: typesafe" \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -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](/product/ai-gateway/configs)
* **Caching** — [Simple and semantic caching](/product/ai-gateway/cache-simple-and-semantic)
* **Guardrails** — Before-request checks on the `state` field only. See [Guardrails for Decisions](/product/guardrails/decisions-guardrails)
* **Observability** — Logs, cost tracking, and analytics in [Observability](/product/observability)

## API Reference

* [Create a Decision](/api-reference/inference-api/decisions) -- `POST /v1/decisions`

<CardGroup cols={2}>
  <Card title="TypeSafe" icon="bolt" href="/integrations/llms/typesafe">
    Provider setup and pricing
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/inference-api/decisions">
    Decisions API reference
  </Card>

  <Card title="Universal API" icon="arrows-rotate" href="/product/ai-gateway/universal-api">
    All API formats
  </Card>

  <Card title="Guardrails for Decisions" icon="shield" href="/product/guardrails/decisions-guardrails">
    Scan `state` before it reaches the model
  </Card>
</CardGroup>

***

<Card title="Portkey is now PRISMA AIRS AI Gateway. See it in action." href="https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey&utm_medium=referral&utm_campaign=prisma_airs&utm_content=docs_nav#contact" icon="arrow-up-right-from-square">
  Contact Us
</Card>


## Related topics

- [Decisions](/api-reference/inference-api/decisions.md)
- [Guardrails for Decisions Requests](/product/guardrails/decisions-guardrails.md)
- [Handle streaming output guardrails for client-side decisions](/guides/use-cases/streaming-output-guardrails.md)
- [5. Architectural Considerations](/guides/whitepapers/optimizing-llm-costs/architectural-considerations.md)
- [Request Parameters Check](/integrations/guardrails/request-parameters-check.md)


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