Decisions (System One)
POST /v1/systemone answers typed questions about data. You send a state (state) and a set of questions, and in one call the model answers each of them with probabilities. The request and the response follow TypeSafe’s System One API, so the TypeSafe SDK connects by changing the address and the key.
The endpoint serves only models of the decision class; currently that is TypeSafe Jev. GET /v1/models?output_modalities=decisions returns their list; see Models.
First request
Section titled “First request”curl https://api.waibee.com/v1/systemone \ -H "Authorization: Bearer $WAIBEE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "jev-latest", "state": "Customer writes: I want my money back for order 1042", "questions": { "route": { "type": "choice", "instructions": "Which team handles this ticket?", "criteria": {"sales": "buying", "refunds": "money back", "shipping": "delivery"} }, "urgency": { "type": "score", "instructions": "How urgent is it?", "criteria": ["not urgent", "somewhat urgent", "very urgent"] } } }'{ "model": "typesafe/jev-1.13-20260917", "answers": { "route": { "type": "choice", "choice": "refunds", "probabilities": {"sales": 0, "refunds": 1, "shipping": 0}, "confidence": 1 }, "urgency": { "type": "score", "score": 1.09, "legend": {"0": "not urgent", "1": "somewhat urgent", "2": "very urgent"}, "probabilities": {"0": 0.03, "1": 0.85, "2": 0.12}, "confidence": 0.78 } }, "usage": {"input_tokens": 377, "output_tokens": 55}}The answer to each question is in answers under the same key the question was sent with.
From Python
Section titled “From Python”You do not need a separate SDK; any HTTP client will do:
import os
import httpx
response = httpx.post( "https://api.waibee.com/v1/systemone", headers={"Authorization": f"Bearer {os.environ['WAIBEE_API_KEY']}"}, json={ "model": "jev-latest", "state": "Customer writes: I want my money back for order 1042", "questions": { "route": { "type": "choice", "instructions": "Which team handles this ticket?", "criteria": {"sales": "buying", "refunds": "money back", "shipping": "delivery"}, }, }, }, timeout=30,)response.raise_for_status()route = response.json()["answers"]["route"]print(route["choice"], route["confidence"])TypeSafe SDK
Section titled “TypeSafe SDK”The TypeSafe SDK works with Waibee without changes to the calling code: set the Waibee key and address. The SDK appends /v1/systemone to the address itself, so give the address without /v1.
from typesafe_sdk import Noul, TypeSafeClient
with TypeSafeClient(api_key="sk_live_...", base_url="https://api.waibee.com") as client: result = client.system_one( "I was charged twice.", {"billing": Noul(instructions="Is this about billing?")}, ) print(result.nouls["billing"].noul)Instead of arguments, you can use the TYPESAFE_API_KEY and TYPESAFE_BASE_URL environment variables. The SDK’s default model is jev-latest, and the router accepts it as is.
client.models.list() does not work with Waibee: GET /v1/models responds in OpenAI format, while the SDK expects TypeSafe format. To list decision models, use GET /v1/models?output_modalities=decisions.
Request
Section titled “Request”| Field | What it sets |
|---|---|
model | The ID of a decision class model from the catalog. An ID without the provider is read as a TypeSafe model: jev-latest is typesafe/jev-latest |
state | What to evaluate: a string, a JSON object, or an array |
questions | A “key → question” map with at least one question. You choose the keys |
plugins | DLP settings, as in chat requests |
A question has three fields:
| Field | What it sets |
|---|---|
type | choice, score, or noul |
instructions | Required. What is being asked: a string, a JSON object, or an array |
criteria | Options or levels; the shape depends on the type |
The router drops other fields, at the top level and inside a question, and does not pass them to the model.
Question types
Section titled “Question types”type | What the question asks | criteria | What the answer contains |
|---|---|---|---|
choice | Which option from a set fits | An “option → when to choose it” object | choice with the key of the chosen option, probabilities across options, confidence |
score | Which level of a scale fits | An array of levels, from lowest to highest | score on the scale of level numbers, legend with a description of each number, probabilities across levels, confidence |
noul | Whether a statement is true | Optional: an object with the keys true and false | noul, the probability that the statement is true, from 0 to 1 |
An option or level description, like instructions, can be a string, a JSON object, or an array. The model checks how many options and levels are allowed and what else a question requires: a question that breaks its rules is rejected with 400. How to phrase questions and read probabilities is covered in the TypeSafe documentation.
Response
Section titled “Response”modelnames the version of the model that responded. Withjev-latest, it is a specific version, for exampletypesafe/jev-1.13-20260917.answershas an entry for each key inquestions, in the form the model returned it.usagehas tokens only:input_tokensandoutput_tokens.output_tokensis present only if the model returned it. If the model returned no counters, the response has nousage.plugins.dlpis present if DLP inmaskoralertmode found something; see DLP.
Limitations
Section titled “Limitations”- Text volume is limited to 15 MB for
stateand the questions together. Their whole JSON counts: keys, quotes, andtypefields are included, unlike in chat requests, where only the text counts. Going over returns413with the codetext_content_too_large; see Limits. - Nesting of
state,instructions, and option descriptions: no deeper than 64 levels. A deeper request is rejected with422and the codevalidation_error. - Decision models only. A model of another class on this endpoint is rejected with
400and the codemodel_endpoint_mismatch, and so is a decision model on the chat endpoints. - No
waibee/auto. Autorouting picks only among chat models, sowaibee/autois rejected here with400and the codefeature_not_supported. - No streaming. The response always arrives in full.
Your key’s DLP policy and the plugins.dlp field work here the same way as for chat; see Plugins. Since there are no messages here, a few things differ:
-
Each string in
state,instructions, andcriteriais checked the same way as ausermessage. Keys are checked too: question keys and any object key insidestate,instructions, andcriteria. Numbers are checked; booleans are not. -
A finding names the path to the string, and its
message_indexis-1:Where it was found locationstateas a stringstateA field inside statestate.customer.emailAn element of a statearraystate[2]A question’s instructionsquestions.route.instructionsAn option description questions.route.criteria.salesA scale level questions.urgency.criteria[1]An option key questions.route.criteria{sales}A key inside statestate.customers{[email protected]}A question key questions{route} -
report_scopenarrows nothing: the response has all findings, andblockrejects the whole request with403and the codedlp_violation. -
With
mask, the model receives a token instead of the value found. The value is restored in the response: if the response quotes your text, aslegenddoes forscore, you see your own words. -
A direct
maskorblockfinding in a key or number rejects the request with403 dlp_violation. A protected value repeated in astatekey or number hides its containing object and keeps the request going. Inquestions, the response names questions and options by their keys, so a repeated value in a key or number also gives403 dlp_violationwith a safe place name. Underalert, the request stays unchanged and the finding is reported.
Errors
Section titled “Errors”Errors come in Chat Completions format: an error object with the fields code, message, and extra. Codes are shared across all endpoints: Errors.