# System One (https://inference.net/docs/api/system-one)

The System One API answers typed questions about a state in one request. Use it with a decision model. A decision model serves only `POST /v1/systemone`. It does not serve chat completions or text completions.

## Endpoint

```
POST https://api.inference.net/v1/systemone
```

Send your API key in the `Authorization: Bearer` header, as for other endpoints. The response is one JSON object. The endpoint does not stream.

## Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `model` | string | Yes | The identifier of a decision model. |
| `state` | string or object | Yes | The input the questions are about. |
| `questions` | object | Yes | One or more questions, keyed by a question id that you choose. It must not be empty. |

Each value in `questions` is an object with these fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | Yes | One of `noul`, `choice` or `score`. |
| `instructions` | string | No | Instructions for this question. |
| `criteria` | any | No | Criteria for this question. The API sends it to the model unchanged. |

The API sends other fields in the request body and in each question to the model unchanged.

```bash
curl https://api.inference.net/v1/systemone \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<decision-model>",
    "state": "The customer asks for a refund for an order that arrived damaged.",
    "questions": {
      "is_refund_request": { "type": "noul" },
      "department": {
        "type": "choice",
        "instructions": "Pick the team that handles this ticket.",
        "criteria": ["billing", "shipping", "support"]
      }
    }
  }'
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `model` | string | The model identifier you sent. |
| `answers` | object | One answer for each question, keyed by the question id from the request. The shape of each answer depends on the question type and the model. |
| `usage.input_tokens` | integer | The number of input tokens the model read. |
| `usage.output_tokens` | integer | The number of output tokens. A decision generates no tokens, so this is `0`. |

```json
{
  "model": "<decision-model>",
  "answers": {
    "is_refund_request": { "...": "..." },
    "department": { "...": "..." }
  },
  "usage": { "input_tokens": 41, "output_tokens": 0 }
}
```

The `x-inference-id` response header contains the generation id.

## Billing

You pay for `usage.input_tokens` as prompt tokens. There are no completion tokens.

## Errors

Errors use the same JSON shape as other endpoints: `{"error": {"message": "...", "type": "..."}}`.

| Status | Cause |
| --- | --- |
| 400 | The body has no string `model`, no string or object `state`, or no non-empty `questions` object. |
| 400 | A question is not an object, or its `type` is not `noul`, `choice` or `score`. |
| 400 | The model is not a decision model. Call it with `POST /v1/chat/completions` or `POST /v1/completions`. |
| 400 | You called a decision model with `POST /v1/chat/completions` or `POST /v1/completions`. Call it with `POST /v1/systemone`. |
| 403 | Your team does not have access to the model. |
| 404 | The model does not exist. |