Typed Decisions Endpoint
Models that return calibrated probabilities instead of text
This endpoint does not produce text. It returns a calibrated probability between 0 and 1 for the binary question you ask — "does this customer want a human?", "is this message reporting a blocking outage?". It is faster and cheaper than forcing a JSON schema on a chat model and parsing the answer, and parse errors do not exist here, because what comes back is already a number.
Typed Decision Endpoint (/v1/decisions)
This endpoint does not produce text. It returns a calibrated probability between 0 and 1 for the binary question you ask — "does this customer want a human?", "is this message reporting a blocking outage?". It is faster and cheaper than forcing a JSON schema on a chat model and parsing the answer, and parse errors do not exist here, because what comes back is already a number.
| Model | Endpoint | Latency | Price (USD) |
|---|---|---|---|
convai/laya-multilingual |
POST /v1/decisions |
~50 ms | $0.042 / 1M |
typesafe/jev |
POST /v1/decisions |
~600 ms | $0.063 / 1M |
- convai/laya-multilingual answers binary (
noul) questions only and runs on our own server in Turkey. typesafe/jev supports all three question types (noul,choice,score) and returns a confidence value with every answer. - Only binary decision questions are supported for now (
"type": "noul"). You can ask up to 32 questions in one request. - The model runs on our own server in Turkey; the request does not go to a third-party provider.
- Only input tokens are billed; output is free.
- If you need choice (
choice) or score (score) questions, connect your own provider key from the dashboard and use the same endpoint.
curl https://api.onysoft.com/v1/decisions \
-H "Authorization: Bearer sk-ony-..." \
-H "Content-Type: application/json" \
-d '{
"model": "convai/laya-multilingual",
"state": "Botla degil gercek bir yetkiliyle gorusmek istiyorum.",
"questions": {
"insan_istiyor": {
"type": "noul",
"instructions": "Does the user ask to talk to a human agent instead of the bot?"
}
}
}'
{
"success": true,
"data": {
"model": "convai/laya-multilingual",
"answers": {
"insan_istiyor": { "type": "noul", "noul": 0.9626, "confidence": 0.9626 }
},
"usage": { "input_tokens": 65, "output_tokens": 0 },
"billing": "onysoft",
"latency_ms": 52
}
}
For Turkish text, writing the instruction in English gives markedly more accurate results, and leaving criteria out improves accuracy on most binary questions. In our own measurement this setup scored 20/20 on 20 Turkish support messages.
Question Types
| Type | Capability | Returns |
|---|---|---|
noul | Yes/no question | A probability between 0 and 1 (<code>noul</code>) plus a confidence value |
choice | One of the options you define | The chosen label, the probability of each option and a confidence value |
score | A score across labelled levels | A fractional score, per-level probabilities and a confidence value |
convai/laya-multilingual currently answers noul questions only; other types return 400 unsupported_question_type. typesafe/jev supports all three.
Using Your Own Provider Key
In addition to the catalogue models, you can connect your own account with the typed decision provider. Requests are then forwarded with your key and billed directly to your account with that provider.
GET /v1/provider-keys # kayitli anahtarlar (anahtarin kendisi DONMEZ)
POST /v1/provider-keys # {"provider":"typed-decisions","api_key":"...","label":"..."}
DELETE /v1/provider-keys/{provider} # anahtari kaldir
curl https://api.onysoft.com/v1/provider-keys \
-H "Authorization: Bearer sk-ony-..." \
-H "Content-Type: application/json" \
-d '{"provider": "typed-decisions", "api_key": "SAGLAYICI-ANAHTARINIZ"}'
- Requests made with your own key are not deducted from your Onysoft balance; the amount appears as 0 in your usage records.
- Keys are stored encrypted and are never returned by any endpoint; only a hint made of the last four characters is shown.
- You can also add and remove keys from the dashboard.
Error Codes
| Code | code |
Description |
|---|---|---|
| 400 | unsupported_question_type | A question type this model does not support was sent (for example a score question to a binary-only model). |
| 400 | invalid_request | <code>state</code> or <code>questions</code> is missing, or more than 32 questions were sent in one request. |
| 412 | provider_key_required | A model that only works with your own key was requested, but you have no key on file. |
| 429 | rate_limited | The model is busy right now. Wait a moment and try again. |
| 503 | service_unavailable | The decision service is temporarily unavailable. |
Limits and Billing
- Up to 32 questions per request; all of them are answered in a single pass.
- Only input tokens are billed, output is free. The amount is recorded in your usage log as usual.
- The context limit depends on the model: each model's context window is listed on the catalogue page.