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

# Decisions

> Classify, route, and score text and images with calibrated probabilities from Liquid decision models, all in a single request.

Decision models answer typed questions about a state with calibrated probabilities instead of generated text. One request can ask several questions, and the model answers them all in a single forward pass with no generated tokens. Use them for classification, routing, scoring, and yes/no gates.

The endpoint, [`POST /decisions/v1/systemone`](https://docs.liquid.ai/api/reference/decision-models/make-decisions), implements [TypeSafe's System One API](https://docs.typesafe.ai/api), so the official TypeSafe SDKs work with the base URL `https://api.liquid.ai/decisions`.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
# pip install typesafe-sdk
import os

from typesafe_sdk import Choice, Noul, TypeSafeClient

client = TypeSafeClient(
    api_key=os.environ["LIQUID_API_KEY"],
    base_url="https://api.liquid.ai/decisions",
    model="d1.1",
)

response = client.system_one(
    state="Help! My payouts have been failing for 3 days.",
    questions={
        "department": Choice(
            instructions="Which team should handle this?",
            criteria={"billing": "Payments", "technical": "Bugs, outages", "sales": "Pricing"},
        ),
        "is_urgent": Noul(instructions="Does this convey urgency?"),
    },
)

print(response.answers["department"].choice, response.answers["is_urgent"].noul)
```

```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
// npm install @typesafe-ai/sdk
import { TypeSafeClient, choice, noul } from "@typesafe-ai/sdk";

const client = new TypeSafeClient({
  apiKey: process.env.LIQUID_API_KEY,
  baseURL: "https://api.liquid.ai/decisions",
  defaultModel: "d1.1",
  compression: false, // the API doesn't accept zstd-compressed request bodies
});

const { answers } = await client.systemOne({
  state: "Help! My payouts have been failing for 3 days.",
  questions: {
    department: choice("Which team should handle this?", {
      billing: "Payments",
      technical: "Bugs, outages",
      sales: "Pricing",
    }),
    is_urgent: noul("Does this convey urgency?"),
  },
});

console.log(answers.department.choice, answers.department.confidence, answers.is_urgent.noul);
```

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://api.liquid.ai/decisions/v1/systemone \
  -H "Authorization: Bearer $LIQUID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "d1.1",
    "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, outages", "sales": "Pricing" }
      },
      "is_urgent": { "type": "noul", "instructions": "Does this convey urgency?" }
    }
  }'
```

## Question types

| Type | Answers | Use it for |
| - | - | - |
| Noul | One probability that the answer is yes. | Yes/no gates, moderation, flags. |
| Choice | The most likely option, its confidence, and the full distribution over options. | Classification and routing. |
| Score | The most likely level, its confidence, and the full distribution over ordered levels. | Rating and prioritization. |

## Models

| Model | Input | Use it for |
| - | - | - |
| `d1-ultra` | Text, images | Harder decisions. |
| `d1.1` | Text, images | The default decision model. |

Both are billed on input tokens only; output is free. Requests may be up to 4.5 MB, and validation errors return `422`.

## Learn more

> [card] [d1](https://docs.liquid.ai/lfm/models/d1)
>
> Every question type in depth, image inputs, image token usage, and pricing.

> [card] [Decision models](https://docs.liquid.ai/lfm/models/decision-models.md)
>
> The open-weight decision models you can run yourself.


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