Jev tutorial
Jev tutorial: build a ticket router
In this tutorial you'll build a small support ticket router: every incoming ticket gets a team, an urgency flag, and a fallback path when the model is unsure.
Get Early Access to ClassifierHub: 2× credits in your first paid month.
1. Define the decision
Write down the answers you want before writing code: which teams exist, what counts as urgent, and what should happen when the model is uncertain. These become your criteria and your thresholds.
2. Make the request
Send the ticket as state and ask both questions in one request.
curl https://openrouter.ai/api/alpha/decisions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "typesafe/jev-1.13",
"state": "Hi, I was charged twice for my subscription this month.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "Payments, invoices, refunds, charges",
"technical": "Bugs, errors, outages",
"other": "Anything else"
}
},
"refund": {
"type": "noul",
"instructions": "Is the customer asking for money back?",
"criteria": { "true": "Asks for a refund", "false": "No refund request" }
}
}
}'3. Turn probabilities into actions
Keep policy in code. Route to the chosen team only when confidence is above your threshold; otherwise send the ticket to a triage queue. Flag urgency when the noul probability crosses 0.5, then tighten based on data.
4. Calibrate on real examples
Label 50 to 100 real tickets, run them once and store the answers. Replay thresholds against the stored answers to pick values with a clear margin between correct and incorrect cases. You only pay for the first run.
5. Handle failure
Add a timeout, retry transient errors, and define a safe default when no decision is available. For a router, the safe default is the human triage queue.
Frequently asked questions
Related guides
Last updated 2026-09-25. ClassifierHub is an independent product built on top of the Jev decision model, accessed through OpenRouter. It is not affiliated with or endorsed by TypeSafe or OpenRouter.