System One
Typed, calibrated decisions from codai-s1 in one forward pass — choice, score and yes/no questions.
codai-s1 answers typed questions about a state without generating text, typically in 80–300 ms. Gate your action on the returned confidence, and keep your own fallback: when the model is unavailable the gateway answers 503 s1_unavailable and never substitutes a generative model unless you ask for it.
- Batch — send
items: [{ id, state }](up to 16) instead ofstateto ask the samequestionsabout several states at once; the answer isitems: [{ id, answers }]in request order (client.systemOne.batch(...)/client.system_one.batch(...)). timeout_ms— 100–5000 ms budget for this call (default 1500).fallback: "codai-fast"— opt in to a generative fallback: when codai-s1 is unavailable, codai-fast answers the same questions with the same answer shapes, and the response carriesfallback_used: true(plus thex-codai-s1-fallbackheader). Its probabilities are less calibrated, so lower your thresholds or log the flag.
bearerAuthAuthorizationBearer <codai_…>A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).
x-request-id?stringClient correlation id; echoed back as x-codai-trace-id and persisted on the usage row.
length <= 128x-codai-session-id?stringGroups requests of one conversation for receipts, stickiness and prompt caching.
length <= 128application/json- body
Send exactly one of state (single) or items (batch).
state?||array<unknown>Text, JSON object or array the questions are about (≤ 64 000 chars serialised).
items?array<>Batch mode — the same questions asked about each item's state, concurrently. Ids must be unique.
1 <= items <= 16questions*1-32 questions keyed by an id you choose; answers come back under the same ids.
timeout_ms?integercodai-s1 budget for this call in milliseconds (default set by the gateway, 1500).
100 <= value <= 5000fallback?stringcodai-fast lets the gateway answer with codai-fast (structured output) when codai-s1 is unavailable; the response then has fallback_used: true.
"none""none""codai-fast"model?stringAccepted for symmetry; only codai-s1 is served.
One typed answer per question id (answers), or per item and question id (items) for a batch.
application/json- response
answers for a single state, items for a batch.
model*stringcodai-s1, or codai-fast when the opt-in fallback answered.
answers?items?array<>Batch results in request order.
usage*latency_ms*integerfallback_used?booleanPresent and true only when codai-s1 was unavailable and the opt-in codai-fast fallback answered.
curl -X POST 'https://ai.codai.ro/v1/systemone' \ -H 'Content-Type: application/json' \ -d '{ "questions": { "property1": { "type": "choice", "instructions": "string" }, "property2": { "type": "choice", "instructions": "string" } }}'{ "model": "string", "answers": { "property1": { "type": "choice", "choice": "string", "score": 0, "noul": 0, "confidence": 0, "probabilities": { "property1": 0, "property2": 0 }, "legend": { "property1": "string", "property2": "string" } }, "property2": { "type": "choice", "choice": "string", "score": 0, "noul": 0, "confidence": 0, "probabilities": { "property1": 0, "property2": 0 }, "legend": { "property1": "string", "property2": "string" } } }, "items": [ { "id": "string", "answers": { "property1": { "type": "choice", "choice": "string", "score": 0, "noul": 0, "confidence": 0, "probabilities": { "property1": 0, "property2": 0 }, "legend": { "property1": "string", "property2": "string" } }, "property2": { "type": "choice", "choice": "string", "score": 0, "noul": 0, "confidence": 0, "probabilities": { "property1": 0, "property2": 0 }, "legend": { "property1": "string", "property2": "string" } } } } ], "usage": { "input_tokens": 0, "output_tokens": 0 }, "latency_ms": 0, "fallback_used": true}Last updated: