# Decisions

The OpenAPI 3.1 document is the full description, including schemas:

https://router.inference.ai.exchange/v1/openapi.json

## `POST /v1/systemone`

Answer typed questions about a situation, in the shape of the hosted Jev API.

A Jev client works when it changes the address and the key. The smallest
request is `{"model": "liquid.decision", "state": "...", "questions":
{"q1": {"type": "choice", ...}}}`. Name a decision deployment as `model`, or
use `liquid.decision` to buy from the cheapest.

The request is one job of kind `decision`, with its own cap, hold and
receipt. The charge is the input tokens that the provider read, at the input
rate, never above the cap. The cap holds the prompt up to 64 times.

If no decision deployment is live, or `model` is not one, the exchange asks
chat models for log probabilities. Each question becomes several one-token
jobs with the options in different orders. Only offers that declare
`sampling.logprobs` can win. The `exchange` block lists the jobs and their
total charge. The header `x-liquid-orderings` sets the orderings for each
choice question (default 4). The exchange cannot verify the probabilities.
It refuses an answer that cannot be right.

Differences from the hosted API:

- A choice question has 2 to 20 options, not 255. A score question has 2 to
  10 levels.
- One prompt has at most 32,000 tokens. A longer one gets `422`, and
  `error.param` is `state`.
- `confidence` is one minus the normalized entropy of the probabilities. The
  hosted API does not document its formula, so set the threshold again.
- A model name that starts with `jev-` means `liquid.decision`.
- Backticked paths in a question, such as `` `ticket.id` ``, are not
  resolved.
- The exchange does not set the temperature, so the same request can return
  different probabilities.
