// Server-side JavaScript (Node 20+ or Bun). Set JEV_API_KEY.
const response = await fetch("https://jevaimodel.net/v1/systemone", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.JEV_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "liquid/d1",
"state": "I was charged twice for order A-4471. Please refund the duplicate payment.",
"questions": {
"route": {
"type": "choice",
"instructions": "Which team should handle this ticket? Use other when no option fits.",
"criteria": {
"billing": "Payments, charges and refunds",
"technical": "Bugs and product errors",
"account": "Login and account access",
"other": "None of these teams"
}
}
}
}),
});
const body = await response.json();
if (!response.ok || body.code !== 0) throw new Error(body.message);
console.log(body.data.result.answers);
console.log(body.data.creditsUsed);
How the 50% margin calculation works
Credits are worth $0.0001 each at the listed pack rate. For a nonzero upstream cost, a 50% gross margin requires a selling price equal to twice that cost: credits per million = upstream dollars per million × 20,000. For reference, Jev at $0.042 per million input tokens would require 840 credits per million for 50%; its current 600-credit rate corresponds to a 30% gross margin. Liquid d1's current $0 listing instead bills at the 1-credit request minimum.