Decisions and classification
POST /v1/systemone evaluates one state (the text, or any JSON, you want judged) against
named, typed questions and returns one answer per question, with probabilities and a
confidence. Use it to triage mail and requests: which team should answer, is it urgent, is it
spam, how frustrated is the sender. A chat model gives you free text to parse; this gives you
numbers you can put a threshold on.
There are three question types:
| Type | Asks | Answer |
|---|---|---|
noul |
a yes/no question | noul: the probability of yes, 0 to 1 |
choice |
which one of 2 to 20 options | choice (the most likely option), probabilities, confidence |
score |
a rating on 2 to 10 ordered levels | score (the expected level), legend, probabilities, confidence |
The request and response are compatible with the System One request format used by TypeSafe’s
Jev SDKs. siema_ai is not affiliated with TypeSafe. The model that answers is
qwen/qwen3.8-27b: send that as model.
A request
Section titled “A request”curl https://api.siema-ai.pl/v1/systemone \ -H "Authorization: Bearer $SIEMA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen3.8-27b", "state": "Dzień dobry, od trzech dni nie mogę opłacić faktury nr 12/2026.", "questions": { "pilne": { "type": "noul", "instructions": "Czy klient potrzebuje odpowiedzi dziś?" }, "dzial": { "type": "choice", "instructions": "Który dział powinien odpowiedzieć?", "criteria": { "faktury": "Faktury, płatności, zwroty", "techniczny": "Błędy, awarie, integracje", "sprzedaz": "Ceny, nowe umowy" } } } }'{ "model": "qwen/qwen3.8-27b", "answers": { "pilne": { "type": "noul", "noul": 0.91 }, "dzial": { "type": "choice", "choice": "faktury", "probabilities": { "faktury": 0.94, "techniczny": 0.05, "sprzedaz": 0.01 }, "confidence": 0.91 } }, "usage": { "input_tokens": 412, "output_tokens": 2, "cost_micro_pln": 3135 }}state is a string, an object or an array (objects and arrays are sent to the model as compact
JSON). The keys of questions are your own ids; the answers come back under the same ids, and
the ids are never shown to the model. instructions is a string, an object or an array.
From Python
Section titled “From Python”TypeSafe’s Python SDK takes a base_url, an api_key and a model on its client, so it works
against siema_ai by pointing those at siema_ai (see TypeSafe’s
Python SDK usage, “Configuring the base URL”):
import os
from typesafe_sdk import Choice, Noul, TypeSafeClient
with TypeSafeClient( api_key=os.environ["SIEMA_API_KEY"], base_url="https://api.siema-ai.pl", model="qwen/qwen3.8-27b",) as client: result = client.system_one( "Dzień dobry, od trzech dni nie mogę opłacić faktury nr 12/2026.", { "pilne": Noul(instructions="Czy klient potrzebuje odpowiedzi dziś?"), "dzial": Choice( instructions="Który dział powinien odpowiedzieć?", criteria={ "faktury": "Faktury, płatności, zwroty", "techniczny": "Błędy, awarie, integracje", "sprzedaz": "Ceny, nowe umowy", }, ), }, ) print(result.nouls["pilne"].noul, result.choices["dzial"].choice)The SDK is TypeSafe’s, not ours; its own documentation is the reference for it. Any HTTP client works as well, since the request is plain JSON.
The three types
Section titled “The three types”noul takes instructions and, optionally, criteria with a true and a false
description saying what each answer means. The answer is the probability of yes.
choice takes instructions and criteria: a map of option to its description
(a string, an object, an array or null), 2 to 20 options. The answer lists every option’s
probability (they sum to 1), the most likely option, and a confidence. Options keep the order
you sent them in; a tie goes to the first.
score takes instructions and criteria: an ordered array of 2 to 10 level descriptions,
lowest first. The answer has probabilities and a legend, both keyed by the level’s index as a
string ("0", "1", …); legend maps the index to your description. score is the sum of
each level’s index times its probability, so it can fall between levels.
Limits: 1 to 32 questions per request. A request over a limit, with a missing criteria on a
choice or a score, or with an unknown type, is 400 invalid_request with the offending field
in param. Unknown fields are ignored. Text only; no streaming.
How the numbers are computed
Section titled “How the numbers are computed”Each question is answered in one token: the model’s first generated token is a single letter or
digit (Y or N for a noul, A to T for the options of a choice, 0 to 9 for the
levels of a score), and the probabilities are read from that token’s log-probabilities,
normalised over the answer tokens. An option the model gave a vanishing chance is reported as
0.0. If the model produced none of the answer tokens, the request fails with
502 upstream_unavailable; siema_ai never makes up an answer.
confidence follows TypeSafe’s published formulas, from 0 (no idea) to 1 (certain). For a
choice with n options and the largest probability p_max:
confidence = (p_max - 1/n) / (1 - 1/n)For a score with n levels, m the most likely level and p_i the probability of level i:
confidence = max(0, 1 - sum_i(p_i * |i - m|) / MAD_unif)MAD_unif = (1/n) * sum_i |i - (n - 1)/2|So a choice split (0.6, 0.3, 0.1) has confidence 0.4, and a score split (0, 0.57, 0.43) has confidence 0.355. Treat the probabilities and the confidence as the model’s own, not as calibrated against your data: measure them on a sample of your own mail before you set a threshold.
Billing
Section titled “Billing”Each question is one model call, billed at qwen/qwen3.8-27b’s chat prices for its tokens. The
text of state goes into every question’s call, so a request with ten questions about one long
mail pays for that mail ten times. usage sums the tokens of every call and carries
cost_micro_pln, the cost of the whole request, as on every response with usage (see
Billing and credits). A request that fails, or that you cancel by
closing the connection, is free.
Questions run in parallel, a few at a time, so latency grows with the number of questions. The request takes one slot of your rate and concurrency limits, like a chat request.
Differences from Jev
Section titled “Differences from Jev”Jev’s side as TypeSafe’s documentation described it on 2026-10-14; TypeSafe’s own documentation is the reference for Jev.
| Jev | siema_ai |
|---|---|
422 on a malformed body |
400 invalid_request in siema_ai’s error format, as on every /v1 route |
| up to 255 options in a choice | up to 20 |
| no stated limit on questions | at most 32 per request |
GET /v1/models in TypeSafe’s shape |
siema_ai’s OpenAI-shaped list; it shows which models have the decisions capability |
jev-* model names |
the real model id, qwen/qwen3.8-27b; a TypeSafe model name is an unknown model (404 model_not_found) |
A model without the decisions capability is 400 invalid_request. The Batch API does not
serve this route.
As with chat, siema_ai stores, logs and traces none of the state or the questions: usage
metadata only. The text goes to the model’s upstream provider, Scaleway SAS in Paris, France,
which may keep request content for up to 14 days, only to investigate abuse or errors, under its
own terms. See Data handling and retention.