TokenRa
中文Get API Key

Decision model · TypeSafe AI

Jev API

Jev is TypeSafe AI's decision model. It does not write text: you send a state (the text or JSON to judge) plus named questions, and every answer comes back typed, with probabilities and a confidence value.

Model ID
jev-latest
Input
Text or JSON state
Output
Typed answers
Latency
Under 1 s

Capabilities

Capabilities & endpoints

One synchronous endpoint. Jev does not use the chat format, so the OpenAI and Anthropic SDKs do not apply; send plain HTTPS requests. Calling jev-latest on /v1/chat/completions returns an error.

POSThttps://tokenra.io/v1/decisionsTested
Send a state and named questions; every answer comes back typed. Auth: Authorization: Bearer.

Questions

Question types

Each question has a name you choose, a type, instructions and, depending on the type, criteria. All three types were answered on 2026-10-23.

typecriteriaAnswer fields
noulOptional. Object with exactly the keys "true" and "false", each describing when it applies.noul: probability (0–1) that the answer is true.
choiceRequired. Object that maps each option key to its description, at least one option.choice (the most likely key), probabilities per option, confidence.
scoreRequired. Array of at least two level descriptions, from the lowest to the highest.score (0 to number of levels − 1, can be fractional), legend, probabilities per level, confidence.

Request

Request parameters

ParameterTypeRequiredDescription
modelstringYesjev-latest. The response reports the version that answered, for example typesafe/jev-1.14-20261014 or jev-1.14.0.
statestring / object / arrayYesWhat to judge, shared by every question: text, or JSON such as a ticket or a record. Chinese text was tested.
questionsobjectYesYour question names mapped to question objects; at least one. Each answer comes back under the same name.
questions.*.typestringYesnoul, choice or score.
questions.*.instructionsstring / object / arrayYesThe question itself.
questions.*.criteriaobject / arrayNoDepends on the type, see the table above. Required for choice and score.
streambooleanNoNot supported. Leave it out; true returns an error.

Response

Response format

Response from the example request (2026-10-24)
{
  "model": "typesafe/jev-1.14-20261014",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "probabilities": {
        "billing": 0.88,
        "technical": 0.12,
        "sales": 0
      },
      "confidence": 0.82
    },
    "frustration": {
      "type": "score",
      "score": 1.02,
      "legend": {
        "0": "Calm",
        "1": "Frustrated",
        "2": "Very angry"
      },
      "probabilities": {
        "0": 0,
        "1": 0.98,
        "2": 0.02
      },
      "confidence": 0.97
    },
    "is_urgent": {"type": "noul", "noul": 0.95}
  },
  "usage": {"input_tokens": 427, "output_tokens": 73},
  "id": "gen-dec-1792772733-dG0LU2uG8E83JEMaXCmh",
  "provider": "TypeSafe"
}
FieldTypeDescription
modelstringThe Jev version that answered.
answers.<name>.typestringThe question type.
answers.<name>.noulnumbernoul only: probability that the answer is true.
answers.<name>.choicestringchoice only: the most likely option key.
answers.<name>.scorenumberscore only: expected level, from 0 to the number of levels − 1.
answers.<name>.probabilitiesobjectchoice and score: probability of each option or level; they add up to 1.
answers.<name>.legendobjectscore only: level index to your level description.
answers.<name>.confidencenumberchoice and score: confidence from 0 to 1. Use it to route unsure cases to a person.
usageobjectinput_tokens and output_tokens used for billing.
id / providerstringRequest ID and serving provider, when the upstream includes them.

The answers are keyed by your question names; do not rely on their order. In testing they came back sorted by name, not in request order.

During testing the upstream answered in two shapes: with model like typesafe/jev-1.14-20261014 plus id and provider, or with model like jev-1.14.0 and no extra fields. answers and usage were the same in both, so read only the fields you need.

Errors

Errors & limits

Request validation

Invalid requests return HTTP 400 with error.code invalid_request and one of these messages. Do not retry them; fix the request.

MessageCause
questions must not be emptyquestions is missing or empty.
state must be a string, object or arraystate is missing, for example when a chat messages body is sent instead.
unsupported question type; expected noul, choice or scoreUnknown type.
choice criteria must be a nonempty object of choicesA choice question without options.
score criteria must contain at least two string levelsA score question with fewer than two levels.
noul criteria must contain only true and false string descriptionsOther keys in noul criteria.
decisions do not support streamingstream: true was sent.

Common errors

HTTPerror.codeMeaningWhat to do
401—Missing, wrong or deleted API key. The message is Invalid token.Check the Authorization: Bearer header and the key in the console.
400—The body is not valid JSON.Fix the JSON and send Content-Type: application/json.
403insufficient_user_quotaYour balance or plan quota is used up.Top up in the console, then retry.
503model_not_foundUnknown model ID, or no channel serves it for your group.Check the ID in the model list or with GET /v1/models.
429—Too many requests.Back off exponentially and retry.
5xx—The upstream provider failed or timed out.Retry a few times; keep the request id if it persists.

Limits and notes

  • Requests took 0.35 to 1 second in testing.
  • Billing: input and output tokens are both charged at $0.042 per 1M tokens (checked 2026-10-24). A test request with 358 input and 60 output tokens was charged 9 quota units, that is $0.000018. Question definitions count as input tokens. Rates can change; the live rate is on the Model Square.
  • A one-sentence state with the three example questions used 427 input and 73 output tokens; question definitions count as input.