# Decisions API

> POST /api/v1/decisions — typed decisions. Send state and typed questions; get structured answers. Not chat. POST /api/v1/systemone is the same handler.


# Decisions API

Evaluate application **state** against typed **questions** and get structured **answers** (probabilities, not generated chat text). This is TypeSafe's System One contract — **not** OpenAI Chat Completions.

::endpoint{method="POST" path="/api/v1/decisions"}

`POST /api/v1/systemone` is the same handler, auth, and body. Prefer `/api/v1/decisions`.

:::note
Authenticate with an **LLM API key** (`sk-ar-v1-…`) from [/dashboard/keys](https://dash.anyrouter.dev/keys), sent as `Authorization: Bearer …`. You also need a BYOK key for a provider that serves Jev, saved under [Dashboard → BYOK](https://dash.anyrouter.dev/byok): [TypeSafe](https://console.typesafe.ai/settings/keys), [LLM Gateway](https://llmgateway.io), [Vercel AI Gateway](https://vercel.com/docs/ai-gateway/authentication-and-byok/api-keys), [AIHubMix](https://aihubmix.com/token), or [AutoJev](https://autojev.ai/settings/apikeys).
:::

:::warning
Do not send decision requests to `/chat/completions`. Jev is a decision model (`capability: systemone`) and is rejected on chat-shaped endpoints.
:::

## Request

| Field | Type | Required | Description |
|---|---|---|---|
| `state` | string \| object \| array | yes | Content to evaluate: plain text or structured application state. |
| `model` | string | yes | Catalog id, e.g. `typesafe/jev`. Aliases: `typesafe/jev-latest`, `typesafe/jev-preview`, `typesafe/jev-1.13.0`. |
| `questions` | object | yes | Non-empty map of question id → `{ type, instructions, criteria? }`; do not send an array. Types: `noul`, `choice`, `score`. |

### Question types

| `type` | Meaning | Answer |
|---|---|---|
| `noul` | Yes/no; optional `criteria` is an object with `true` and `false` descriptions | `noul` probability in `[0, 1]` |
| `choice` | One option; `criteria` must be an object map of option → description or `null` | `choice`, `probabilities`, `confidence` |
| `score` | Ordered `criteria` array with 2–10 level descriptions | `score`, `legend`, `probabilities`, `confidence` |

## Response

```json
{
  "model": "jev-1.13.0",
  "answers": {
    "is_urgent": { "type": "noul", "noul": 0.92 }
  },
  "usage": { "input_tokens": 312, "output_tokens": 48, "cost": 0 }
}
```

Upstream TypeSafe bills **input tokens** only (output is free). This hop is BYOK: AnyRouter does not charge credits.

## Example

```bash
curl -sS https://anyrouter.dev/api/v1/decisions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "Help! My payouts have been failing for 3 days.",
    "model": "typesafe/jev",
    "questions": {
      "is_urgent": {
        "type": "noul",
        "instructions": "Does this convey urgency?"
      }
    }
  }'
```

See TypeSafe's [API reference](https://docs.typesafe.ai/api) and [models](https://docs.typesafe.ai/models) for primitives, confidence, and rate limits.
