How to Use Jev for Support Ticket Routing (Fewer Misroutes)

Updated Applies to Jev 1.13

TL;DR: Ticket routing is a choice question — “which queue does this belong to?” Jev, the System One judgment model from TypeSafe AI, answers it directly with a structured {answer, confidence, rationale} response. Send low-confidence results (below ~0.85) to a human queue and misroutes drop sharply. This page shows the input/output contract, an architecture sketch, and a minimal end-to-end implementation under 50 lines.

What the routing decision looks like

Define the task narrowly before writing any code:

{"answer":"billing","confidence":0.94,"rationale":"Customer reports a duplicate charge and requests a refund."}

The answer field drives the branch, confidence drives automation, and rationale is what your agents read when they pick the ticket up.

Why a judgment model fits

Chat models are optimized for open-ended generation, so routing with them means parsing free text and hoping the format holds. Jev is built for exactly this shape of work.

AspectChat modelJev (choice call)
OutputFree-form text you must parseStructured answer / confidence / rationale
Task framingPrompt engineering to suppress chatterNative choice question
Automation signalNone by defaultconfidence for thresholds
ExplainabilityVariesrationale attached to every decision
Failure modeOff-format replies, ramblingLow-confidence result you can route to a human

Architecture

Ticket arrives (subject + body)
        |
        v
Preprocess (truncate, strip PII, join subject + body)
        |
        v
Jev choice call via OpenRouter (typesafe/jev-1.13)
        |
        v
Parse structured result {answer, confidence, rationale}
        |
        +--> confidence >= 0.85 --> auto-route to the chosen queue
        |
        +--> confidence <  0.85 --> human queue, rationale shown to agent

No functions or frameworks in the diagram on purpose — the whole pipeline is four logical steps plus one threshold branch.

Minimal end-to-end implementation

import os, json, requests

URL = "https://openrouter.ai/api/v1/chat/completions"
# Confirm the exact model slug on the OpenRouter model page.
MODEL = "typesafe/jev-1.13"
QUEUES = ["billing", "technical", "account", "other"]

SYSTEM = ("You are a ticket router. Choose exactly one queue from: "
          + ", ".join(QUEUES) + ".")

def route(subject: str, body: str) -> dict:
    resp = requests.post(
        URL,
        headers={"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}"},
        json={
            "model": MODEL,
            "messages": [
                {"role": "system", "content": SYSTEM},
                {"role": "user", "content": f"Subject: {subject}\n\n{body[:4000]}"},
            ],
            "temperature": 0,
        },
        timeout=30,
    )
    resp.raise_for_status()
    # example fixture:
    # {"answer":"billing","confidence":0.94,"rationale":"..."}
    return json.loads(resp.json()["choices"][0]["message"]["content"])

result = route("Refund not received", "I was charged twice this month...")
if result["confidence"] < 0.85 or result["answer"] not in QUEUES:
    print("ACTION=human-review", result)
else:
    print("ACTION=route queue=", result["answer"], "conf=", result["confidence"])

That is the whole loop: call, parse, branch. Anything the OpenAI-compatible SDK calls (JavaScript, Go, etc.) works the same way — only the HTTP client changes.

Parameters and thresholds

SettingRecommendationWhy
Task typechoiceRouting is a pick-one decision, not a yes/no or a score
Auto-route thresholdconfidence >= 0.85Conservative default; tune against your own misroute samples
Low-confidence pathHuman queue + rationaleAgents see why the model hesitated
Unknown labelTreat as low confidenceAny answer outside your queue list goes to the human queue
Body truncation~4,000 charactersEnough signal, keeps latency predictable

For deeper background on the three task types, see the guide on Jev’s three primitives, and for threshold design see confidence and fallback patterns. The case study on email routing across three teams shows this exact setup running in production.

Applies to Jev 1.13.

FAQ

Frequently asked questions

Why use Jev instead of a chat model for ticket routing?

Routing is a choice question, not a conversation. Jev is a System One judgment model built for judgment, choice, and scoring tasks, so it returns a structured answer with confidence instead of free-form text that you have to parse.

What confidence threshold should I use before auto-routing?

A practical starting point is 0.85. Route automatically when confidence is at or above the threshold, and send everything below it to a human queue together with the model's rationale.

Which model id should I call on OpenRouter?

This guide uses typesafe/jev-1.13 on the OpenAI-compatible endpoint https://openrouter.ai/api/v1/chat/completions. Confirm the exact model slug on the OpenRouter model page before you ship.

Keep reading