What each field means
The request defines the questions and answer formats. The response returns a separate result for each question. These are the fields you can inspect in the request preview and model response above.
Request fields
model- The model ID. This Playground pins typesafe/jev-1.13 so the version is explicit.
state- The shared facts to evaluate. This form sends your text as state.input.
questions- A map of named questions. This Playground sends one or three in each request.
<question_id>- A name such as action or urgency. Its answer is returned under the same name.
type- The answer format: choice selects an option, score rates ordered levels, and noul evaluates a yes/no question.
instructions- The specific judgment the model should make using the shared state.
criteria- Choice options, ordered Score levels, or the false/true meanings for a Noul question.
Response fields
answers- One typed result per question, keyed by the same question ID.
choice- The selected option key for a Choice question.
probabilities- The probability distribution across Choice options or Score levels; values add up to about 1.
confidence- A separate value derived from the distribution for Choice and Score. It is not the selected option’s probability.
score- A probability-weighted position on your ordered levels. It can fall between two levels.
legend- The Score levels mapped back from their numeric positions to the descriptions you supplied.
noul- The probability of yes, from 0 (no) to 1 (yes). Noul has no separate confidence field.
The questions in a multiple-question case share one state but are evaluated independently. One answer is not fed into another. This Playground caps a run at three questions and counts it as one daily attempt. A correctly shaped answer can still be wrong, so test representative cases before automating an action.
LangChain · PythonPut Jev inside a LangChain agent harness
An agent harness controls the model and tool loop. At a decision point, Jev reads a message, proposed tool call, or agent state and returns a typed answer. Your code decides the next step; the chat model still handles open-ended work.
ModelRouterMiddlewarebefore_agent → wrap_model_callClassify the latest user message before the run, choose a model, and keep that choice for subsequent model calls. The choice, probabilities, and confidence remain available in agent state.
AutoModeMiddlewarewrap_tool_callCheck a selected tool call before it executes. If Jev flags risk or insufficient authorization, the middleware blocks it and returns an error ToolMessage. It does not request human approval.
TypeSafeClassifierChoice · Score · NoulAdd your own checkpoint with custom middleware: pass agent messages or state to TypeSafeClassifier, ask Choice, Score, or Noul questions, then branch in code or send uncertain cases for review.
LangChain · Python · ModelRouterMiddleware
# pip install "langchain-typesafe[experimental]" langchain-openai
# Set TYPESAFE_API_KEY and OPENAI_API_KEY on your server.
from langchain.agents import create_agent
from langchain_typesafe.experimental.middleware import (
ModelChoice, ModelRouterMiddleware,
)
router = ModelRouterMiddleware(
choices={
"fast": ModelChoice(
model="openai:gpt-5.6-terra",
criteria="Simple lookups and extraction.",
),
"powerful": ModelChoice(
model="openai:gpt-6-astra",
criteria="Complex reasoning and high-stakes decisions.",
),
},
instructions="Choose the least costly model that can do the task safely.",
)
agent = create_agent("openai:gpt-5.6-terra", middleware=[router])
result = agent.invoke({"messages": [{"role": "user", "content": "Summarize this log."}]})
print(result["model_route"].choice)
A server-side OpenRouter request
TypeScript · fetch// Run on your server. Keep the API key out of browser code.
const apiKey = process.env.OPENROUTER_API_KEY;
if (!apiKey) throw new Error("Set OPENROUTER_API_KEY");
const response = await fetch("https://openrouter.ai/api/alpha/decisions", {
method: "POST",
headers: {
Authorization: "Bearer " + apiKey,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "typesafe/jev-1.13",
state: {input: "A customer reports a duplicate charge."},
questions: {
team: {
type: "choice",
instructions: "Which team should handle this?",
criteria: {
billing: "Payments and refunds",
technical: "Bugs and integrations"
}
},
urgency: {
type: "score",
instructions: "How urgent is the issue?",
criteria: ["Can wait", "Needs attention today", "Immediate action"]
},
escalate: {
type: "noul",
instructions: "Should a human review this first?",
criteria: {false: "No review needed", true: "Review before acting"}
}
}
})
});
if (!response.ok) throw new Error("Decision request failed");
const {answers} = await response.json();
console.log(answers.team.choice, answers.urgency.score, answers.escalate.noul);
Before using a decision in production
TypeSafe accepts text, JSON objects, or arrays of text as state; this simple form wraps your text under input. Jev does not accept images, audio, or video. Typed output keeps the format predictable, but an individual judgment can still be wrong. Test on your own examples and define when your code should ask for review.