Decisions

Decisions (Jev)

Ask typed questions about your data and get answers your code can act on: the probability of yes, one option from a set, or a place on a scale, with calibrated probabilities, usually in under a second. Served on TypeSafe’s own API, so its SDKs work unchanged.

POST/v1/systemone
ModelIDInput, per 1M tokensTypeSafe’s priceOutput
Jev 1.14jev-1.14$0.024$0.042Free
Jev 1.13jev-1.13$0.035$0.042Free

Jev is TypeSafe’s decision model, which it calls a System One model: it understands natural language like a chat model, but instead of writing text it answers the questions you define. jev-latest, jev-1.14.0 and typesafe/jev-1.14 work as model IDs too, and jev-1.13 stays available for prompts tuned on it.

Ask questions

# pip install typesafe-sdk
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient
with TypeSafeClient(
base_url="https://api.zurelay.com",
api_key="YOUR_ZURELAY_KEY",
model="jev-1.14",
) as client:
response = client.system_one(
state={"ticket": "I was charged twice for October, please refund one today."},
questions={
"refund": Noul(instructions="Is the customer asking for money back?"),
"team": Choice(
instructions="Which team should handle this?",
criteria={"billing": "Charges and refunds", "technical": "Bugs and outages"},
),
"urgency": Score(
instructions="How urgent is it?",
criteria=["can wait", "this week", "today"],
),
},
)
print(response.nouls["refund"].noul) # 0.98
print(response.choices["team"].choice) # billing
print(response.scores["urgency"].score) # 1.9

With TypeSafe’s SDKs, set the base URL to https://api.zurelay.com, without /v1: they add /v1/systemone themselves. The TYPESAFE_BASE_URL and TYPESAFE_API_KEY environment variables work too. Any HTTP client works the same way: send your Zurelay key as a Bearer token.

The answer

Response
{
"id": "req_8Kq2vXbN4tR7mWc1pLs9dYe3",
"model": "jev-1.14",
"answers": {
"refund": { "type": "noul", "noul": 0.98 },
"team": {
"type": "choice",
"choice": "billing",
"probabilities": { "billing": 1.0, "technical": 0.0 },
"confidence": 1.0
},
"urgency": {
"type": "score",
"score": 1.9,
"legend": { "0": "can wait", "1": "this week", "2": "today" },
"probabilities": { "0": 0.0, "1": 0.1, "2": 0.9 },
"confidence": 0.81
}
},
"usage": { "input_tokens": 396, "output_tokens": 61, "cost": 0.00001386 }
}

Each answer comes back under the name you gave its question. usage is what the request was billed on, and cost what it cost in US dollars. The same request can give an answer a point or two apart from one call to the next.

Parameters

modelstringrequired
jev-1.14, jev-latest (the same model) or jev-1.13.
statestring, object or arrayrequired
The content to decide about: a text, or structured data such as a record, a chat log or your app’s current state. Refer to a field in a question by its name in backticks, such as `ticket`.
questionsobjectrequired
Your questions, each under a name you choose. The answers come back under the same names, and the names aren’t sent to the model.
Each question
typestringrequired
noul, choice or score.
instructionsstring, object or arrayrequired
The question. An object can hold the question in one field and data it refers to in others.
criteriaobject or array
For a choice (required): an object of options, each with a description or null, up to 255. For a score (required): an array of 2 to 10 levels, lowest first. For a noul (optional): true and false, what a yes and a no mean.

Question types

TypeAsksAnswer
noulA yes or no questionnoul: the probability of yes, from 0 to 1
choiceWhich of your options fitschoice, the probabilities of every option, and a confidence
scoreWhere it sits on your ordered scalescore, which can land between levels, a legend, the probabilities of each level, and a confidence

One request can mix all three, and asking many questions costs little more than one: the state is read once, and every question is answered against it in parallel.

Limits

  • Up to 64K tokens a request, the state and every question together, and 32K for the state plus the longest question.
  • Text only: a string, a JSON object or an array. Turn images, PDFs or audio into text first.
  • No streaming: the answers come back whole, usually in under a second.
  • A malformed request (a missing instructions, a score with one level) is refused with a 400 before it reaches the model, and costs nothing. So is one over 64K tokens, with the code context_length_exceeded.

Getting good answers

Jev reads instructions literally, so write the exact condition and put boundary cases in the criteria. Keep counting, arithmetic and date comparisons in code, and send only the part of the state the question needs. It can lean toward the first option of a choice: for an important decision, check that the answer holds with the options reordered.

Paying for decisions

Jev is billed on the input tokens it counts: your state and questions, plus about 270 tokens of its own on every request. The answers are free, as at TypeSafe. A short request of about 300 tokens costs about $0.00001, so a million of them cost about $10. Each reply’s usage and x-zurelay-input-tokens header say what it was billed on, every request is in your request log, and requests that fail cost nothing.

Try your own content and questions in the dashboard’s Playground: pick Jev, paste the content, set the questions beside it, and its Get code button writes the same request in Python, Node.js or cURL.

Questions, or something missing? Ask our support team and we’ll answer by email, usually within a minute.