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
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
  }
}
lightbulb

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
noulYes/no questionA probability between 0 and 1 (<code>noul</code>) plus a confidence value
choiceOne of the options you defineThe chosen label, the probability of each option and a confidence value
scoreA score across labelled levelsA 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"}'

Error Codes

Code code Description
400unsupported_question_typeA question type this model does not support was sent (for example a score question to a binary-only model).
400invalid_request<code>state</code> or <code>questions</code> is missing, or more than 32 questions were sent in one request.
412provider_key_requiredA model that only works with your own key was requested, but you have no key on file.
429rate_limitedThe model is busy right now. Wait a moment and try again.
503service_unavailableThe decision service is temporarily unavailable.

Limits and Billing

Want help finding the right model?