Model APIs / Decisions

# Decisions

Ask a decision model named questions about a piece of content and get typed answers back.

`POST` `/v1/decisions` `inference:invoke`[Browse decision models →](https://yelno.ai/catalog?type=decisions)

## Request

| Field | Required | Notes |
| --- | --- | --- |
| model | required | A decision model's id. |
| state | required | The content to judge — a string, object or array. |
| questions | required | Maps a name to a question: `{type: "noul", instructions}` (the probability that the statement holds), `{type: "choice", instructions, criteria: {option: guidance}}` or `{type: "score", instructions, criteria: [level guidance, …]}`. |

Request

```
curl https://yelno.ai/v1/decisions \
  -H "Authorization: Bearer $YELNO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL",
    "state": "Customer: I was charged twice for order 8812 and want one refunded.",
    "questions": {
      "is_billing_issue": {"type": "noul", "instructions": "The message is about a billing problem."},
      "intent": {
        "type": "choice",
        "instructions": "What does the customer want?",
        "criteria": {"refund": "Asks for money back.", "information": "Asks a question only."}
      },
      "urgency": {
        "type": "score",
        "instructions": "How urgent is this?",
        "criteria": ["Can wait a week.", "Should be answered today.", "Needs action now."]
      }
    }
  }'
```

## Response

200 · application/json

```
{
  "answers": {
    "is_billing_issue": { "type": "noul", "noul": … },
    "intent": { "type": "choice", "choice": "refund", "confidence": …, "probabilities": { … } },
    "urgency": { "type": "score", "score": …, "confidence": …, "probabilities": [ … ] }
  },
  "usage": { … },
  "yelno": { … }
}
```

Each answer is keyed by its question's name: `{type: "noul", noul}`, `{type: "choice", choice, confidence, probabilities}` or `{type: "score", score, confidence, probabilities}`.

Every JSON response carries the same `yelno` block a chat response does: `request_id`, `provider`, `model`, `endpoint_id`, `attempts` and `cost`. `cost` is `{state: "final", currency, customer_nanos}` when the provider reported the cost with the response, or `{state: "pending", currency, note}` when it reports it later — the charge then settles once. Errors use the standard [error envelope](https://yelno.ai/docs/errors); upstream text never reaches you.

Sending a model to a route it is not served on answers `422` `capability_unsupported` with `code: "operation_unsupported"` and a message naming the route that serves it. Every model in the [catalog](https://yelno.ai/catalog?type=decisions) shows its type and route.

Pricing. You pay the model's listed final price — shown on its catalog page — and nothing on top. A model without a fixed unit price is billed per request: its exact charge comes back with every response in `yelno.cost`. A hold is placed before dispatch and released down to the final charge; when the charge is reported after the response, the request settles once — it is never charged a guess.

Source: https://yelno.ai/docs/decisions
