Jev API integration
Understand Jev
Jev, by TypeSafe, is a decision model, not a chat model. Give it a piece of text and a question, and it answers directly: which category, what score, yes or no. The result is ready for your code to use. For example, route a "charged twice" complaint to the billing team, or score a review.
It uses the TypeSafe API. OpenAI Chat Completions is not compatible, and Jev cannot be used as the chat model in Codex or Claude Code.
Get an API key
Get your TeamoRouter API key from the dashboard and store it in the TEAMOROUTER_API_KEY environment variable. Existing keys work as they are; no TypeSafe account is needed.
Integrate with the official SDK
The official TypeSafe SDKs work unchanged: point base_url at TeamoRouter and use your TeamoRouter API key. The SDKs default to jev-latest; on TeamoRouter set the model to jev.
Python (pip install typesafe-sdk):
import os
from typesafe_sdk import Choice, TypeSafeClient
client = TypeSafeClient(
api_key=os.environ["TEAMOROUTER_API_KEY"],
base_url="https://api.teamorouter.com", # the only line that changes
model="jev",
)
response = client.system_one(
state="I was charged twice for the same order.",
questions={
"department": Choice(
instructions="Which team should handle this customer message?",
criteria={
"billing": "Charges, payments and refunds",
"technical": "Bugs and integration issues",
"other": "Other requests",
},
),
},
)
print(response.answers["department"])
TypeScript (npm install @typesafe-ai/sdk):
import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient({
apiKey: process.env.TEAMOROUTER_API_KEY,
baseURL: "https://api.teamorouter.com", // the only line that changes
});
const response = await client.systemOne({
model: "jev",
state: "I was charged twice for the same order.",
questions: {
department: choice("Which team should handle this customer message?", {
billing: "Charges, payments and refunds",
technical: "Bugs and integration issues",
other: "Other requests",
}),
},
});
console.log(response.answers.department);
Call the endpoint directly
Send POST https://api.teamorouter.com/v1/systemone with an Authorization: Bearer <TeamoRouter API key> header. The request body follows the TypeSafe schema. This example routes a duplicate charge complaint to billing, technical or other:
curl --fail-with-body 'https://api.teamorouter.com/v1/systemone' \
-H "Authorization: Bearer $TEAMOROUTER_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "jev",
"state": "I was charged twice for the same order.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this customer message?",
"criteria": {
"billing": "Charges, payments and refunds",
"technical": "Bugs and integration issues",
"other": "Other requests"
}
}
}
}'
Read the answer
Read answers.department.choice for the category, probabilities for its distribution and confidence for the classification confidence.
| Type | Criteria | Answer |
|---|---|---|
choice |
Option names mapped to descriptions | choice, probabilities, confidence |
score |
An ordered array of 2–10 rubric levels | score, legend, probabilities, confidence; scores may be fractional |
noul |
Optional true and false descriptions |
noul: the probability of yes, from 0 to 1 |
Questions are evaluated independently against the same state. Their answers are keyed by the question names. One answer is not automatically passed to the next question. See TypeSafe primitives for the full question syntax.
Check pricing and limits
Jev is on a limited-time promotional price on TeamoRouter: input is billed at 99.9% off the list price and output is free. See live pricing for the current rate. State plus the longest question must fit within 32K tokens; state plus all questions must fit within 64K. A choice supports up to 255 options and a score uses 2–10 levels. English works best; validate other languages with your own examples.
Do not send messages, stream, temperature or max_tokens.
Troubleshoot calls
- 401: check the key and the
Authorization: Bearerheader. - 400: check
state,questions, the question type andcriteria; the error message names the field. - 404: confirm the
/v1/systemonepath. - 429: you exceeded the rate limit; retry with exponential backoff. The official SDKs retry automatically.
See the TypeSafe API reference for the native schema.