Jev API examples
Real request shapes for the hosted /api/v1/decide endpoint. Run the same scenarios in the playground before pasting production keys.
Support triage (choice + noul)
Route a frustrated billing message and decide whether to escalate — classic bounded decision, not a chat completion.
curl https://jevtypesafe.org/api/v1/decide \
-H "Authorization: Bearer jv_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"state":"Customer: charged twice, waiting 5 days",
"questions":{"topic":{"type":"choice","instructions":"Route",
"criteria":{"billing":"money","bug":"broken","account":"login"}},
"escalate":{"type":"noul","instructions":"Escalate to a human?"}}}'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: charged twice, waiting 5 days",
questions: {
topic: {
type: "choice",
instructions: "Route",
criteria: { billing: "money", bug: "broken", account: "login" },
},
escalate: { type: "noul", instructions: "Escalate to a human?" },
},
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://jevtypesafe.org/api/v1/decide",
headers={"Authorization": f"Bearer {os.environ['JEV_API_KEY']}"},
json={
"state": "Customer: charged twice, waiting 5 days",
"questions": {
"topic": {
"type": "choice",
"instructions": "Route",
"criteria": {"billing": "money", "bug": "broken", "account": "login"},
},
"escalate": {"type": "noul", "instructions": "Escalate to a human?"},
},
},
)
print(r.json())