Developers
How to use the hosted Jev API
One endpoint: send a state plus typed questions, get structured answers back. Auth with a jv_live_ key from this site — prepaid input tokens, output free. Upstream TypeSafe keys stay on our servers.
Source reference:
1. The endpoint
Every call is a POST to https://jevtypesafe.org/api/v1/decide, authenticated with a Bearer token. Put your key in JEV_API_KEY (never commit it).
Header: Authorization: Bearer jv_live_…Header: Content-Type: application/json- Create keys on Account after buying a prepaid pack (or using monthly free tokens).
curl https://jevtypesafe.org/api/v1/decide \
-H "Authorization: Bearer $JEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "Customer: I was charged twice and nobody has replied for 3 days.",
"questions": {
"route": {
"type": "choice",
"instructions": "Where should this go?",
"criteria": { "billing": "money", "bug": "broken", "account": "login" }
},
"urgency": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": ["routine", "today", "urgent", "critical"]
},
"escalate": {
"type": "noul",
"instructions": "Escalate to a human now?"
}
}
}'import os
import requests
resp = requests.post(
"https://jevtypesafe.org/api/v1/decide",
headers={
"Authorization": f"Bearer {os.environ['JEV_API_KEY']}",
"Content-Type": "application/json",
},
json={
"state": "Customer: I was charged twice and nobody has replied for 3 days.",
"questions": {
"route": {
"type": "choice",
"instructions": "Where should this go?",
"criteria": {"billing": "money", "bug": "broken", "account": "login"},
},
"urgency": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": ["routine", "today", "urgent", "critical"],
},
"escalate": {
"type": "noul",
"instructions": "Escalate to a human now?",
},
},
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())const res = await fetch("https://jevtypesafe.org/api/v1/decide", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.JEV_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
state: "Customer: I was charged twice and nobody has replied for 3 days.",
questions: {
route: {
type: "choice",
instructions: "Where should this go?",
criteria: { billing: "money", bug: "broken", account: "login" },
},
urgency: {
type: "score",
instructions: "How urgent is this?",
criteria: ["routine", "today", "urgent", "critical"],
},
escalate: {
type: "noul",
instructions: "Escalate to a human now?",
},
},
}),
});
if (!res.ok) throw new Error(await res.text());
console.log(await res.json());Test your key — run this exact request against the live endpoint, once:
Sends the request above to https://jevtypesafe.org/api/v1/decide with your key and bills one small decision (≈ $0.0004 avg). Your key stays in your browser. In production, keep it server-side.
2. The request body
Two required fields:
- state — context string (ticket text, email body, review, etc.). Max 4,000 characters.
- questions — a map of names → question objects. All questions in one request share the state and run in one round trip.
3. The three question types
choice — pick one option
Pass a criteria map of labelled options. Response includes the winning key, per-option probabilities, and confidence.
"topic": {
"type": "choice",
"instructions": "What is the primary issue?",
"criteria": {
"billing": "billing or payment problem",
"bug": "the product is broken",
"account": "login or access"
}
}score — position on a scale
Pass an ordered criteria array (2–10 levels). Response returns a numeric score plus the distribution over levels.
"severity": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": [
"routine",
"handle today",
"urgent",
"critical, about to churn"
]
}noul — calibrated yes / no
No criteria — only instructions. Response is a probability in [0, 1].
"escalate": {
"type": "noul",
"instructions": "Escalate to a human immediately?"
}4. The response
Typed answers mean you branch in code — no JSON-in-string parsing. Example shape:
{
"model": "jev-latest",
"answers": {
"route": {
"type": "choice",
"choice": "billing",
"confidence": 1.0,
"probabilities": { "billing": 1.0, "bug": 0.0, "account": 0.0 }
},
"urgency": {
"type": "score",
"score": 2.0,
"confidence": 0.9,
"probabilities": { "0": 0.05, "1": 0.1, "2": 0.7, "3": 0.15 }
},
"escalate": { "type": "noul", "noul": 0.72 }
},
"usage": { "input_tokens": 180, "output_tokens": 40 }
}usage.input_tokens is what we deduct from your prepaid balance. Output tokens are free.
5. Limits & practices
- Rate limit ≈ 60/min per key (plus IP / account / global caps).
- Soft burn caps ≈ 2,000,000 tokens/hour and 20,000,000 tokens/day per account.
- Trim state — you pay per input token.
- Batch several questions in one call so they share the state cost.
- Use confidence / noul thresholds to auto-handle easy cases and escalate the rest.
Get instant access
Sign in, buy a small pack on Pricing, create a jv_live_ key on Account, then call this endpoint. One balance for Core decide and every hosted tool.