# HTTP API

> The supported HTTP routes and fields for decisions, tasks, abstention, health and metrics.

Source: https://opendecisio.com/docs/api/

The server answers [questions](https://opendecisio.com/docs/glossary/#question) on `POST /v1/systemone`; its other routes teach and certify [tasks](https://opendecisio.com/docs/glossary/#task), set [abstention](https://opendecisio.com/docs/glossary/#abstain) [thresholds](https://opendecisio.com/docs/glossary/#threshold), and say what it serves. With a server running, send one choice question:

 shell

```
curl --fail-with-body -sS --max-time 60 http://127.0.0.1:8000/v1/systemone \
  -H 'Content-Type: application/json' \
  -d '{
  "state": "My card keeps getting declined when I renew.",
  "questions": {
    "category": {
      "type": "choice",
      "instructions": "Which team should handle this ticket?",
      "criteria": {
        "billing": "Invoices, payments and refunds",
        "access": "Login, passwords and permissions",
        "bug": "The product behaves wrongly"
      }
    }
  }
}'
```

 

The answers come from a small test model, not the default model.

 

A 422 or 400 carries a `detail` naming the problem; see Errors. The answer’s `confidence` field is System One’s own figure, the [top probability](https://opendecisio.com/docs/glossary/#top-probability) rescaled; thresholds and certificates use the top [probability](https://opendecisio.com/docs/glossary/#probability) itself, the largest of `probabilities`.

 

## Reference

  

| What you need | Route |
| --- | --- |
| Ask questions | POST /v1/systemone |
| Find the served model | GET /v1/models |
| Register, inspect or move tasks | Task routes |
| Manage an abstain [option](https://opendecisio.com/docs/glossary/#option) | Abstention routes |
| Check readiness and task metrics | Health and metrics |
| Read an error | Errors |

 

## POST /v1/systemone

 

Send JSON with `Content-Type: application/json`. The `model` field labels the response; it does not switch the model running on the server.

 

### Request

  

| Field | Type | Meaning |
| --- | --- | --- |
| `state` | string, object or array | the text the questions are about; an object is rendered as `key: value` lines |
| `questions` | object, at least one entry | the questions, by name; the names are the keys of the response's `answers` |
| `model` | string, optional | TypeSafe's API requires it; decisio accepts a request without it. The response's `model` is the name the request sent, or the served model's name when it sent none |
| `images` | array of data URLs, optional | images for the image route (a server started with `--image-model`, or a Gemma base with `--images on`) |
| `assets` | object, optional | System One's images: placeholder names mapped to images, each placeholder found in the state or a question's text is replaced by its image (below) |

 

A prompt, the state with one question, can hold 32,768 tokens on the Qwen base. On a Gemma base it can hold the largest length that fits the card (at least 32,768, at most 98,304 on the 31B and 65,536 on the 12B), which the server chooses at start-up and `/health` reports as `max_model_len` with its reason, unless `--max-model-len` fixed it; with `--image-model` it is 32,768 ([Requirements and limits](https://opendecisio.com/docs/limits/#how-long-a-text-and-how-many-options)). Every measured record in [Evaluate your task](https://opendecisio.com/docs/evaluation-card/#1-choose-a-real-decision) is at 32,768.

 

A prompt over that is answered with 422 and a `detail` that says the rendered prompt is longer than the context, with the lengths vLLM reports (shorten the state or the question and send it again); the server stays up. A NaN or infinity in the engine's probabilities (a model whose arithmetic does not survive the device's dtype or matmul precision, or a checkpoint served under a profile that is not its own) is answered with 500 and a `detail` that says the values are not finite, that the request is not at fault, and which served model and engine produced them. The same holds for the examples of `POST /v1/tasks` and `POST /v1/abstention/tasks`.

 

Fields the server does not know are ignored, so extensions (such as `orders`, for two-order averaging) and fields added to the wire format later do not break a request.

 

**`adapter` (optional, decisio's extension).** The name of a LoRA adapter the server loaded with `--adapter name=path`; the question is then answered by the base with that adapter (text route only). Without the field, or with `null` or an empty string, the base answers.

 

An unknown name is answered 404 with the name and the adapters that are loaded; a value that is not a string is 422. The response carries `"adapter": "<name>"` (and the header `x-decisio-adapter`) when an adapter answered. The registered tasks (calibration, [intent head](https://opendecisio.com/docs/glossary/#intent-head), certificates, abstention thresholds) were fitted on the base's readout, so a question that one of them matches is answered 400 with the task named, not with a correction that does not fit.

 

The temperature is the adapter's own for the question's type when the adapter has one (`--adapter-temperatures`, [running.md](https://opendecisio.com/docs/deploy/adapter/)), and otherwise the base's. The task registration and certification routes refuse an `adapter` field instead of ignoring it.

 

**`think` (optional, decisio's extension).** `true` or `false`: whether the questions of this request that are unsure are read again after the served model has written its reasoning ([running.md](https://opendecisio.com/docs/think/)). Absent or `null`, the server's setting (`--think`, or a tuned repository's `defaults.think`; off unless one of them says otherwise). A value that is not a boolean is 422, and so is `true` on a server whose engine cannot write reasoning (the vLLM engine can).

 

When thinking is on for the request the response carries `"thinking": {"questions": n, "of": m, "tokens": t, "ms": ms, "factor": f, "budget": b, "per_question": {name: {"thought": true, "tokens": n} or {"thought": false, "why": ...}}}`, `usage.thinking_tokens` and the headers `x-decisio-think-ms` and `x-decisio-think-tokens`; `usage.output_tokens` is then one per question plus the reasoning tokens. A question of a registered task, one with more than 16 options, and every question of a request that asks for two orders, an abstention option or the image route stays at one read and the response says why.

 

**`layout` (optional, decisio's extension).** `"plain"` or `"header"`: the layout of the user turn this request is read under ([running.md](https://opendecisio.com/docs/layout/)). `"header"` lists the request's questions before the state; `"plain"` is the state, a blank line, then the question.

 

Absent or `null`, the server's layout (`--layout`, or the one the server decided at start: `/health`, `systemone.layout`); any other value is 422, naming the two. A request of either layout is built token for token as a server started with that `--layout` builds it, and it is looked up among the registered tasks, and certified, as that server would do it:

 

- A registered task applies only to the requests of the layout it was fitted under (`POST /v1/tasks` and `POST /v1/abstention/tasks` take `layout` too, [tasks.md](https://opendecisio.com/docs/limits/#what-is-kept-for-each-prompt-layout)). A question of a certified task fitted under the other layout is answered with decisio's own read, with `certified: false` and `certified_reason: "layout_mismatch"`; a fast table never answers it, and a task that learns from traffic does not log it.
- The response says the layout it was read under in `x-decisio-prompt` (`layout=plain; ...`).
- An adapter, a tuned repository, the temperatures file (`--temperatures-file`) or a flavor that recorded another layout than the request's still answers, as asked, and the response carries `"layout_note"`, for example `"the adapter n1 was trained, and its temperatures fitted, under the header layout"`. It is absent when nothing differs.
- A request with images has no layout on the `--image-model` route (it writes its prompts in the [plain layout](https://opendecisio.com/docs/glossary/#prompt-layout)): the field is 422 there. With `--images on` on a Gemma base the layout applies to images as to text. A server in `--mode packed` reads the plain layout only, so `"header"` is 422 there.
- The two layouts share no cached prefix for a state: a client that alternates them reads the state again on each change ([running.md](https://opendecisio.com/docs/layout/)).
- **Under the header layout, a separate request about a state that an earlier request already read reads the whole state again** when it asks other questions, because the questions come before the state. Send all the questions about a state in one request, the same `header_questions` on every request about it (below), or `"layout": "plain"` on requests that ask about one state one question at a time. Every text request read under the header layout carries `x-decisio-note` saying so, and `/health` counts such re-reads (`systemone.header_layout`, below).

 

**`header_questions` (optional, decisio's extension).** A list of strings: every question the client will ask about this state, each as its instructions as it sends them. Use it when the client asks one question at a time about one state, in separate requests, under the header layout ([running.md](https://opendecisio.com/docs/layout/#how-do-you-keep-the-header-for-a-series-of-questions)).

 

Without it each request lists only its own questions in the header, so a second request about the state has another header, shares no cached prefix and reads the whole state again. With it every request that sends the same list has the same header, the same prefix, and the cache serves the state after the first request. The question asked is still read after the state, as ever.

 

- **Under the header layout** the header lists exactly the declared lines, in the declared order, on every row of the request, in place of the request's own questions. The same request gives the same rows whatever was asked before it.
- **Under the plain layout** the field is checked and has no effect, so one client request works under both layouts.
- **The rules, each a 422 that names the line:** the list is not empty; every item is a string with some text in it; no line repeats (compared with the spaces at its ends removed, which is also how a line is listed); every question of the request has its instructions in the list. A question's line is its `instructions` as sent, or, for a [yes/no question](https://opendecisio.com/docs/glossary/#yesno-question) with `criteria`, the instructions followed by the lines for the criteria, as the header lists them. An absent `instructions` is listed as the server's default line for the question type.
- **A declared header is never cut.** If the header the list makes does not fit the server's prompt limit beside the state and the question (or is over a `--header-limit TOKENS` cap), the request is 422 and says so; the header limit drops lines of a header the request did not declare, which would give two requests of one list different headers. Declare fewer or shorter lines, or send the requests without the field.
- **A registered task** is fitted on one question at a time, with a header of that one question; a request with a declared list reads a longer header than the one the task was fitted on, the same as a request with several questions does ([running.md](https://opendecisio.com/docs/layout/)). A question of a certified task is still scored by the certificate's own read, which lists its own question only.
- **A registration example** (`POST /v1/tasks`, `POST /v1/abstention/tasks`) refuses the field with 422.
- **A request with images** refuses the field with 422.
- `usage.input_tokens` counts the declared header.

 

**`calculator` and `calculator_input` (optional, decisio's extension).** Exact arithmetic support ([calculator.md](https://opendecisio.com/docs/calculator/)): on a server whose model was trained with the calculator block, the line values a state states are computed exactly and shown after it.

 

- `"calculator": false` reads the state without the block; registered tasks then do not apply to the request (naming one with `"task"` is a 422). `true` asks for it; null or absent follows the server. Any other value is a 422.
- `"calculator_input"`: the amounts as structured data instead of being read from the text (the schema is in [calculator.md](https://opendecisio.com/docs/calculator/)). It is validated strictly on any server; an invalid field is a 422 that names its path.
- A model that was not trained with the block (its repository records no `defaults.calculator`, or the server runs `--calculator off`) never sees it: a request that asks for it, or sends amounts, is answered without it, with `x-decisio-warning`.
- `x-decisio-calculator` says whether the block was shown and, if not, why; `usage.input_tokens` counts it.
- Requests with images never carry the block.

 

**A header over the context.** Under the header layout a request whose rows would be over the context because the header lists many long instructions is answered with a header that lists only the first questions that fit (none: the plain layout's row), unless the server was started with `--header-limit off` (then it is a 422 that says where the tokens are).

 

The response then carries `"header_limited": {"layout": "header" | "plain", "listed": K, "of": N, "header_tokens": T, "of_header_tokens": W, "row_limit": L, "allowed_tokens": A, "reason": "context" | "cap"}` and the header `x-decisio-layout`; both are absent when the whole header was listed. A question of a certified task in such a request carries `certified: false` with `certified_reason: "header_limited"` ([running.md](https://opendecisio.com/docs/limits/#what-happens-when-the-header-does-not-fit)).

 

**`over_limit` (optional, decisio's extension).** What to do with a state that makes a row longer than the engine's prompt ceiling (the served context less the one generated token): `"refuse"` or `"truncate"`; absent or `null`, the server's setting (`--over-limit`, or a tuned repository's `defaults.over_limit`; refuse unless one of them says otherwise). A refused request is answered 422, as the engine says.

 

With `"truncate"` the state, never a question, is cut once to its start, so that the longest question of the request still fits, and the request is answered from what was kept. The response then carries `"state_truncated": {"kept_tokens": N, "of_tokens": M, "part": "start", "limit": L}` (the state's tokens kept and in all, and the ceiling) and the header `x-decisio-state-truncated`; both are absent when the whole state was read. **No answer of a truncated state is certified**: a question of a certified task carries `certified: false` with `certified_reason: "state_truncated"`, and the traffic monitor does not count it.

 

A request whose questions alone are over the ceiling is answered 422 whatever the setting; a value other than the two is 422. The MLX and HF builds answer within `--max-model-len` (32,768 unless set), less the one generated token; `--over-limit-tokens` moves the ceiling. Image requests are not cut.

 

**`task` (optional, decisio's extension).** The id of a registered task (`POST /v1/tasks`) that this request is for. It answers the request's questions that ask its question (the same type and options; for a task whose options change with every request, the same instructions), whatever task they would find by themselves, and its context, if it has one, is read before the state ([tasks.md](https://opendecisio.com/docs/tasks/context/)).

 

Without the field each question finds its task by its question, as always; when several tasks ask the same question, each with its own context, a request that names none gets the one without a context, and is answered 422 when there is none without one. The field is 422 when no task has that id, when the task asks none of the request's questions, when the task was fitted under the other layout than the request's (the message names the layout to send), and on the image route. `x-decisio-tasks` says which task answered. An example of a registration that names a task is 422.

 

**A task's context.** A question of a task registered with a `context` is read with the context before the state, so the request sends only the part that changes ([tasks.md](https://opendecisio.com/docs/tasks/context/)). The questions of one request share one read of the state, so they must share one context: a request whose questions' tasks have different contexts, or that mixes a question of a task with a context and a question read without one, is answered 422 (send them as separate requests).

 

A request read under the other layout than its question's context task is answered 422 naming the task and the layout to send, whether or not it names the task: it is never read without the context. A row over the context window is answered 422 with where its tokens are (the header, the task's context, the state, the question), and `over_limit: truncate` cuts the state only, never the context. A request whose state starts with the task's context (leading whitespace aside) is served as sent, so the context is read twice, and the response carries the header `x-decisio-warning: state starts with the task's context; send only the varying part`.

 

Each question:

  

| Field | Type | Meaning |
| --- | --- | --- |
| `type` | `"noul"`, `"choice"` or `"score"` | yes/no, a choice among named options, or a level on an ordered scale |
| `instructions` | string, object or array, optional | the question; an object or array is sent as compact JSON; absent or blank, a fixed default per type |
| `criteria` | depends on `type` | `noul`: optional, `{"true": ..., "false": ...}` describing each side; `choice`: required, an object of option keys to descriptions (or `null`), up to 255 options (more is 422); `score`: required, a list of level descriptions, lowest first |

 

How a question is shown to the model (the layout, the yes/no rendering, which keys are shown) is set by the server's flags, listed in [Server flags](https://opendecisio.com/docs/flags/), and a request may choose the layout (`layout`, above); the answer keys are always the request's own.

 

Images: as many per request as the context holds (the image engine takes up to `--max-images`, 128 unless set), PNG, JPEG or WebP, up to 20 MB each; each costs tokens that count against the context (a 512 by 512 image 256 tokens on the Qwen base). They can be sent as data URLs in `images`, as `data:image/...` URIs anywhere inside the state, or as a `multipart/form-data` request whose `request` field holds the JSON body and whose `image`, `images` or `image[]` fields hold the files.

 

A multipart request must carry one of the headers `X-Decisio-Client` (any value, for example `X-Decisio-Client: my-app`), `X-TypeSafe-SDK` (which TypeSafe's SDK sends on every request) or `TypeSafe-Danger-Zone-Images` (any value), and is refused with 415 without one. So TypeSafe's Python SDK sends images to this server as it does to System One, with nothing added: `Image(...)` anywhere text goes works. A request with images is served by the image engine; the text route is unchanged.

 

Starting the server with `--image-model` makes vLLM's engine run in a process of its own (`--engine-process separate`), which turns off the 31B's in-process `--multi-question warm` default and keeps the context at 32,768 tokens ([Server flags](https://opendecisio.com/docs/flags/)); the image route is measured with the Qwen base only.

 

**Images the System One way (`assets`).** `assets` maps a placeholder name to an image: `{"type": "image", "format": "png"|"jpg"|"jpeg", "data_base64": "..."}`, or, in a multipart request, `{"type": "image", "part": "<the name of an image part>"}` (a part wins over `data_base64`). Every place a placeholder appears, as a string or inside one, in the state or in a question's instructions or criteria descriptions (option keys are not searched; the longest name wins when one contains another), becomes the marker `[image N]` and the asset's bytes become image N, in reading order; a placeholder used twice is two images. That is the same path as a `data:image` URI in the state: the image engine gets the same state text, the same questions and the same images, and gives the same probabilities as the other encodings, with System One's answer fields only (no `unknown_probability` or `abstained`).

 

A placeholder name that matches no asset is plain text. A multipart request puts the `request` part first and every image in a part of its own, with a unique, non-empty name that exactly one asset uses; it needs one of the three headers above like any multipart request here. The SDK names its parts `asset-0`, `asset-1` and so on and labels each with the image's content type.

 

An image part's content type is `image/png`, `image/jpeg`, `image/jpg` or `application/octet-stream`, or it has none; any other is a 400. A problem with an asset (a name no text uses, an empty `assets`, a name that is empty or only whitespace, a format that is not png, jpg or jpeg, bad base64, bytes that are not an image, an animated image, an image part nothing uses, with another content type or shared by two assets, `assets` together with `images`, more images than the engine's `--max-images`) is a 400 with `{"detail": {"error_type": "api_usage_error", "message": "..."}}`, System One's shape for image errors. A placeholder name is at most 1,024 bytes of UTF-8 (bytes, not characters), and all the names of a request together are at most 65,536 bytes; a longer one is a 413 in the same shape.

 

An animated image, a PNG or a WebP with more than one frame, is refused on every encoding (the 422 `bad image: ...` on the older ones); a still image is read as before. A request body over 32 MiB on this route (the JSON, any base64 text and the multipart framing together) is a 413 in the same shape, refused before the body is parsed: by its `Content-Length` when it has one, and otherwise as soon as the bytes read pass the limit. The route's own image limits (20 MB and 20 megapixels per image, the engine's `--max-images`) stay as they are, wider than System One's where they were.

 

System One's `TypeSafe-Danger-Zone-Images` header (any value) is accepted and never required: a request without it is read the same way. A calibration or head task's examples (`POST /v1/tasks`) are text only and refuse `assets`; the examples of `POST /v1/abstention/tasks` may carry them.

 

Where an image stands, and who reads it (the Qwen base, `--image-model`; the same rules as the Gemma bases below). An image is read at the place its reference stands: a placeholder of `assets`, a `data:image` URI in the state, or, for the `images` list and the multipart `image` parts, a literal `[image N]` in the state or in a question's instructions or criteria (the first occurrence of each is its place; a later one stays text). An image of the list that no `[image N]` names opens the state.

 

Every encoding of one picture therefore reads the same. An image in the state is in the prompt every question shares, so it is read from the prefix cache after the first question. An image in a question's instructions or criteria is in that question's own part of the prompt only: no other question's prompt, tokens or `usage.input_tokens` carry it.

 

The prefix is padded to the engine's block and ends after the state's last image, never inside it. `usage.input_tokens` is the request's text plus each image's tokens, the state's once and a question's own once. A `box` question is refused with 400 on this route ("Box questions are not answered on the --image-model route; serve a Gemma 4 base with --images on"); Box needs a Gemma base, and the Qwen base's grounding is not verified.

 

Deprecated: the earlier layout of this route, every image at the start of the turn and so visible to every question, stays for a notice period as `--image-prompt legacy` and is removed in a later release ([Release notes](https://opendecisio.com/docs/releases/)). With it every response to a request with images carries `Deprecation: true` and `Warning: 299 - "..."` headers, and the server logs a warning when it starts and once for every 1,000 such requests.

 

The figures this route has measured so far (ImajevBench, the image temperature of 1.0) were taken on that layout. They are not yet measured on the placed layout, and a new measurement follows; until then they describe the legacy layout only.

 

What an image costs and where it is cut down (the image route runs on the Qwen base, `--image-model Qwen/Qwen3.6-35B-A3B-FP8`; the numbers are that model's processor settings and `smart_resize` from the pinned transformers, computed on 2026-10-14):

 

- An image over 20 MiB, or over 20 megapixels (width times height), or in another format, is refused with 422 (`bad image: ...`) before it is read; a request with more images than `--max-images` (128 unless set) is a 400 `api_usage_error`, as the paragraph above says.
- The processor then resizes the image, keeping its proportions and rounding both sides to multiples of 32, so that it has between 65,536 pixels (256 by 256) and 16,777,216 (4,096 by 4,096). An image of 200 by 200 is read as 256 by 256; one of 4,000 by 6,000 as 3,328 by 4,992.
- Each image costs one token for every 32 by 32 pixels of the resized image, and the tokens count in `usage.input_tokens` and against the 32,768-token context that a server with `--image-model` serves: 64 tokens at the least, 16,384 at the most (1,024 by 768: 768 tokens; 1,920 by 1,080, read as 1,920 by 1,088: 2,040; 4,000 by 6,000: 16,224), plus the two vision delimiter tokens around each image (`usage.input_tokens` counts them, as it counts the Gemma bases' begin and end tokens).
- The Ollama listings are not this route: `aminroudaki/decisio-gemma` and `aminroudaki/decisio-gemma-tuned` read images through Ollama's own `images` field, placed before the state, near each image's own resolution ([running.md](https://opendecisio.com/docs/deploy/mac/#on-a-laptop-with-ollama)).

 

### Response

 json

```
{"model": "decisio-gemma-4-31b-it-letters",
 "answers": {
   "urgent":   {"type": "noul", "noul": ...},
   "category": {"type": "choice", "choice": "access", "confidence": ..., "probabilities": {"billing": ..., "access": ..., ...}},
   "impact":   {"type": "score", "score": ..., "confidence": ..., "legend": {"0": "...", ...}, "probabilities": {"0": ..., ...}}},
 "usage": {"input_tokens": ..., "output_tokens": ...}}
```

 

A shape to fill in, not a command to run.

  

| Answer field | Meaning |
| --- | --- |
| `noul` | the probability of yes |
| `choice` | the most probable option's key; among exactly tied options, the key that sorts first in Unicode code-point order, so the answer never depends on the order the keys arrive in |
| `score` | the probability-weighted mean level |
| `probabilities` | the distribution over the options (choice) or the levels by index (score) |
| `confidence` | System One's confidence: for a choice, the top probability rescaled from uniform; for a score, the concentration at the mode |
| `legend` | each level's index and description |
| `box` | a Box question's box: `top`, `bottom`, `left`, `right`, fractions of the image |
| `unknown_probability`, `abstained` | with the abstention extension of imajev (an open-source System One client and test harness, github.com/mohit67890/imajev; `--abstain-option`): the probability of the offered "can't tell" option and whether the server abstained |

 

`model` echoes the name the request sent, so a client left on the SDK's default model name gets that name back unchanged; a request without one gets the served model's name (`--served-name`, or the base's). `usage.input_tokens` counts the state and each question's own text, and what else is read with them: the header under the header layout, a task's context, both copies under read twice; `usage.output_tokens` is one per question.

 

Response headers:

 

- `x-decisio-server-ms`: the server's time for the request, from the route receiving it to the response: reading and validating the body, loading its images, and every read, including a certified task's questions and the intent head's.
- `x-decisio-route`: the route that served it (`text` or `image`).
- `x-decisio-tasks`: the registered tasks applied, when any were.
- `x-decisio-warning`: something in the request is likely a mistake, though it was served as sent: `state starts with the task's context; send only the varying part` ([tasks.md](https://opendecisio.com/docs/tasks/context/)); absent otherwise.
- `x-decisio-note`: how the request was read, where that has a cost a client can avoid or a limit to know; absent otherwise. It never changes the answers. 
  - On a text request read under the header layout: `header layout: the questions are read before the state, so a later request with other questions about this state reads the whole state again; send all questions about a state in one request, the same "header_questions" on every request about it, or "layout": "plain"` ([running.md](https://opendecisio.com/docs/layout/)).
- On one that sends `header_questions`: `header layout with "header_questions": every request about this state that sends the same list shares its cached prefix; the accuracy of a header that lists questions the request does not ask is not measured yet` ([running.md](https://opendecisio.com/docs/layout/#how-do-you-keep-the-header-for-a-series-of-questions)).
- `x-decisio-calculator`: `shown; lines=N; version=calc-v1`, or `none; reason=<reason>` (why there is none: the state is not read with certainty, `off-by-request`, `not-trained`, `over-limit`, ...); absent when the server shows no block and the request asked for none ([calculator.md](https://opendecisio.com/docs/calculator/#what-does-the-response-say)). With the cascade reader a shown block also names its path (`; path=threshold`, [calculator.md](https://opendecisio.com/docs/calculator/#how-does-the-cascade-reader-read-more)).
- `x-decisio-adapter`: the adapter that answered, when one did.
- `x-decisio-think-ms`, `x-decisio-think-tokens`: the milliseconds spent on reasoning and the second reads, and the reasoning tokens generated, when thinking was on for the request.
- `x-decisio-state-truncated`: `kept=N; of=M; part=start`, when the state was cut (`over_limit`, above); absent otherwise.
- `x-decisio-layout`: `header; listed=K; of=N; reason=context` (or `plain; ...`), when the header listed only some of the request's questions (`--header-limit`, above); absent otherwise.
- `x-decisio-prompt`: `layout=header; tokens=1523; cached=1440`: the layout of the user turn the request was read under (its `layout`, else the server's), the mean prompt tokens the engine read per question, and the mean of them the prefix cache served. Under the header layout a state cached for another set of questions shows as a low `cached`. Absent when the engine does not report prompt sizes.
- `x-decisio-stages`: where the engine's time went, for example `prepare=...;warm=...;questions=...;readout=...;engine=...;wait=...`. `engine` is the request's own engine call; `wait` is the time before it, from the request reaching the engine until it took the engine's lock. A request read with a task's context has `context`: the context's warm-up sent in this request (vLLM) or the context's part of the prefix (MLX), summed over the reads that read the context, so within `engine`, `task` or `head` ([tasks.md](https://opendecisio.com/docs/tasks/context/#1-see-where-it-works-great)). A certified task's questions, read one at a time by the certificate's function or answered by its fast table, are `task`; the intent head's read is `head`; the reasoning pass is `think`; the cascade reader's reading of the state is `calculator`. So `engine + wait + task + head + think + calculator` is the server time within the request's own overhead (a few ms). The wait is 0 on an idle server. With `--concurrency batched`, a request that shared an engine call (`x-decisio-batch`) reports the whole call's `questions` and `engine` times.
- `x-decisio-batch`: `requests=N; rows=M` when the server batches concurrent requests (`--concurrency batched`) and this request's questions were scored in one engine call with other requests' (N requests, M rows in all); absent when it was scored alone.
- `x-decisio-box`: `calibrated=false; tokens=19; flags=none`, on a request with Box questions: whether their confidences went through a fitted calibration, the tokens they wrote, and the readout's flags (`clipped`, `swapped_x`, `swapped_y`, `degenerate_x`, `degenerate_y`); `; absent=true` is added when a Box reply said the target is not there.
- `x-decisio-wait-behind`: `registration` when a boundary registration (`--register-boundary after`) was running when the request arrived, so the `wait` was behind it; absent otherwise.

 

## GET /v1/models

 

Returns `models`, a list of entries with `name`, `description` and `release_date`. Use its served name in clients that require `model`.

 

## Tasks

 

Use [Teach a task](https://opendecisio.com/docs/tasks/) for a complete registration and [Certify answers](https://opendecisio.com/docs/tasks/certify/) to select an [error target](https://opendecisio.com/docs/glossary/#error-target).

  

| Method and route | Request or result |
| --- | --- |
| `POST /v1/tasks` | Register or replace a task using the fields below |
| `GET /v1/tasks` | List task records and their status; `?full=1` includes the complete export |
| `GET /v1/tasks/{task_id}` | Inspect one task and its live status |
| `DELETE /v1/tasks/{task_id}` | Remove the task; 404 when it does not exist |
| `POST /v1/tasks/import` | Import an exported object with a `tasks` array |
| `POST /v1/tasks/{task_id}/certify` | Certify again with new `examples`; optionally set `alpha`, `delta`, `min_examples` and `suspend_on_alert` |
| `POST /v1/tasks/{task_id}/fast_table/rollback` | Select a retained learned-table version with a JSON `version` number |
| `POST /v1/tasks/{task_id}/labels` | Post up to 1,000 labels for a task that takes labels, each with an `answer` and one reference (`request_id`, `digest`, `state` or `text`) |
| `GET /v1/tasks/{task_id}/labels/queue` | List the drawn answers still to label, oldest first, without the served answer |
| `POST /v1/tasks/{task_id}/labels/decline` | Take items you will not label out of the queue, as `{"request_ids": [...]}` |
| `GET /v1/tasks/{task_id}/labels/status` | Counts by state and slice, revisions, and the labels the certificate’s region still needs |
| `PUT /v1/tasks/{task_id}/labels/settings` | Change label settings, which starts a new epoch |
| `GET /v1/tasks/{task_id}/labels/export` | Every logged question with its stored fields, draw, state and label, as JSON lines |
| `PUT /v1/tasks/{task_id}/labels/callback` | Set or change the HTTPS URL for Average error (FDR) marks and return a new signing secret once |
| `POST /v1/tasks/{task_id}/labels/callback/rotate` | Make a new signing secret for the same URL and return it once |
| `DELETE /v1/tasks/{task_id}/labels/callback` | Turn off delivery. The marks stay in the status and export |
| `DELETE /v1/tasks/{task_id}/labels/{request_id}` | Erase one request’s logged answers and labels |
| `DELETE /v1/tasks/{task_id}/labels` | With `?before=<seconds since the epoch>`, erase every answer served and every label received before that time |

 

### Registration fields

  

| Field | Use |
| --- | --- |
| `id` | The task name; registering the same id replaces it |
| `examples` | Labelled examples, each with a one-question `request` and its desired `answer` |
| `question` | The question for a table that learns from traffic, instead of labelled examples |
| `context` | A fixed string, object or array read before each changing state; see [fixed context](https://opendecisio.com/docs/tasks/context/) |
| `layout` | `plain` or `header`, otherwise the server’s layout; the task applies under that layout |
| `certify` | Certificate settings in the table below |
| `labels` | `true`, or settings such as `{"audit_pi": 0.05, "due_days": 7}`, to collect labels from the task’s traffic; without it the task logs nothing per request and its answers carry no request id |
| `fast_table` | `true` for the default student, or the table settings below |
| `options` | `dynamic` for a [question whose options change](https://opendecisio.com/docs/tasks/dynamic/) |
| `match` | `instructions` for a dynamic task |
| `none_option` | The dynamic question’s none-of-these key, `none` by default |

 

### Certificate settings

 

Every key in `certify` is optional.

  

| Field | Use |
| --- | --- |
| `alpha` | Error target; default 0.05 |
| `delta` | Allowed chance the bound does not hold; default 0.1 |
| `min_examples` | Raise the minimum held-out count; the server derives its floor from the targets |
| `holdout` | Share of the registration examples held back, default 0.5 |
| `suspend_on_alert` | Suspend certification while the monitor alerts, default `true` |
| `examples` | Separate labelled certification examples, never used for fitting |
| `target_share` | For a task that takes labels: the certified share to aim at, which sets the region labels are drawn from |
| `looks` | For a task that takes labels: the counts of labelled answers at which a certificate is made, default `[300]` |
| `mode` | `certificate`, the default, or `average_error`, which marks windows of a task’s answers and never certifies them |
| `window` | In `average_error` mode, the answers per window, default 250 |
| `callback` | In `average_error` mode, set `{"url": "https://..."}` to receive signed marks for each closed window |

 

The returned `certificate` includes `threshold`, `alpha`, `delta`, `n`, `certified_share`, `split` and `summary`. A `null` threshold certifies nothing. Each decision says `certified`, `certificate`, `certificate_kind` and, when relevant, `certified_reason`; check these fields in your application.

 

A task that takes labels and asks for a certificate certifies from its traffic labels by default, and its response carries `traffic_certification`; a task with a fast table keeps its certificate from examples.

 

Each answer of a task that takes labels has a `request_id`, which `x-decisio-request-id` also gives for the first question, and `label_requested: true` when the server drew it for a label; send the request’s language as `meta.lang` or `x-decisio-lang`.

 

### Fast-table settings

  

| Field | Use |
| --- | --- |
| `kind` | `static`, `encoder` or `auto` |
| `static_model` | Select the static model, such as `multilingual` |
| `min_saving` | Minimum mean saving, default 0.10, from 0.01 to 0.90 |
| `learn` | Learn from the model’s traffic with `true` |
| `explore` | Share sent to the model even when the table can answer, default 0.02 |
| `max_rows` | Maximum retained learning rows, default 200,000 |

 

A response’s `fast_table_report` says what was kept; each answer’s `answered_by` is `table` or `decisio`. A table learned from model answers has an `agreement` certificate; a certificate based on human labels is `gold`. See [Add a decision fast path](https://opendecisio.com/docs/tasks/fast-table/) for installation, learning, states and rollback.

 

### Task records

 

A task record includes `format`, `id`, `key`, `type`, `options`, `fingerprint`, `calibration`, `head`, `certificate`, `context` and `status`. The `calibration` and `head` results say `applied` and `reason`; a declined correction leaves the original model answer available.

 

The registration response of a choice or yes/no task also carries `label_review`, the labelled examples whose label looks wrong ([Teach a task](https://opendecisio.com/docs/tasks/#check-the-flagged-labels)). The complete export includes the data needed to import the record.

 

With a shared store, `store_version` names the version served.

 

 

## Abstention

 

An abstention threshold tells the server when to choose a designated can’t-tell option. It is separate from a certificate and its application review policy.

 

[Figure: A fitted threshold decides when the server picks the can't-tell option. Request: The options include one designated can't-tell option. Model reads: It scores every option as it always does. Fitted threshold: The server abstains above it and otherwise chooses among the remaining options. Answer: The reported probabilities stay unchanged.]

  

| Method and route | Request or result |
| --- | --- |
| `POST /v1/abstention/tasks` | Register `id`, `option`, `match`, `examples` and optional `layout` |
| `GET /v1/abstention/tasks` | List/export abstention tasks |
| `POST /v1/abstention/tasks/import` | Import the exported tasks |
| `DELETE /v1/abstention/tasks/{task_id}` | Remove an abstention task |

 

Use `option.key` for an option already in the request, or `option.append` for text the server adds. Each example carries `request` and `answer`; `null` means unanswerable.

  

| `match` | Applies to |
| --- | --- |
| `option_set` | The same option keys and descriptions, in any order |
| `option_keys` | Exactly the same set of keys, with varying descriptions or instructions |
| `imajev_extension` | Clients using that abstention extension |

 

An exact option-set task takes precedence over an option-keys task. The server abstains above the fitted threshold and otherwise chooses among the remaining options; reported probabilities stay unchanged. Abstention tasks do not take a fixed `context`.

 

## Errors

  

| What you see | Why | What to do |
| --- | --- | --- |
| 422 with `detail` | The server cannot read the request | Fix what `detail` names |
| 400 with `detail` | The model cannot answer this request | Change the request |
| 404 | `DELETE /v1/tasks/{task_id}` names no task | Check the task id |
| 409 | A concurrent write, or a write to a read-only replica | Read the current version, then replace it, using `x-decisio-replaces` when needed or `?replace=1` |
| 503 | The store is unreachable | The change was not made |
| 500 | A persistent write failed | The change was not made |

 

 

## GET /health

 

Use the HTTP status for readiness: 200 while serving, 503 once the engine is dead. The body names what is running; it can gain fields between releases.

  

| Field | Use |
| --- | --- |
| `ok`, `engine` | Readiness and engine identity |
| `base`, `profile` | Model and serving settings |
| `max_model_len`, `max_model_len_source` | Prompt ceiling and why it was chosen |
| `systemone` | Layout, task and other decision-route settings |
| `image_engine` | Image engine when configured |
| `reason`, `exit_code` | Failure details when the engine is dead |

 

`GET /metrics` returns Prometheus text for certified tasks. See [Operate](https://opendecisio.com/docs/operating/) for supervision and latency headers, and [Watch for drift](https://opendecisio.com/docs/tasks/drift/) for task metrics.

 

 

## Good to know

 

- Keep the server private and call it from your backend; it has no authentication or CORS configuration.
- Unknown request fields are ignored; confirm any field you depend on is documented here.
- A request that is too long returns 422; truncation and layout changes can leave answers uncertified.
- [Move from System One](https://opendecisio.com/docs/migrating/#what-changes) explains supported wire differences.

 

## What next

 

- [Call it from your code](https://opendecisio.com/docs/use-from/): the same request from Python, JavaScript and TypeScript.
- [Teach a task](https://opendecisio.com/docs/tasks/): the task routes, in use.
- [Operate](https://opendecisio.com/docs/operating/): health, restarts and security.
