Entwickler
Gehostete Jev-API nutzen
Ein Endpoint: state plus typisierte questions senden, strukturierte Antworten erhalten. Auth mit jv_live_ von dieser Site — Prepaid-Input-Tokens, Output gratis. Upstream-TypeSafe-Keys bleiben auf unseren Servern.
Quellenangabe:
1. Der Endpoint
Jeder Aufruf ist ein POST an https://jevtypesafe.org/api/v1/decide mit Bearer-Token. Schlüssel in JEV_API_KEY legen (nie committen).
Header: Authorization: Bearer jv_live_…Header: Content-Type: application/json- Schlüssel unter Konto anlegen, nachdem Sie ein Pack gekauft (oder monatliche Gratis-Tokens) haben.
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());Key testen — genau diesen Request einmal gegen den Live-Endpoint:
Sendet den Request an https://jevtypesafe.org/api/v1/decide mit Ihrem Key und berechnet eine kleine Entscheidung (≈ $0.0004 Ø). Der Key bleibt im Browser. In Produktion serverseitig halten.
2. Request-Body
Zwei Pflichtfelder:
- state — Kontexttext (Ticket, E-Mail, Review …). Max. 4.000 Zeichen.
- questions — Map Name → Frageobjekt. Alle Fragen teilen den state in einem Roundtrip.
3. Die drei Fragetypen
choice — eine Option wählen
criteria-Map mit Labels. Antwort: Gewinner-Key, Wahrscheinlichkeiten, 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 auf einer Skala
Geordnetes criteria-Array (2–10 Stufen). Numerischer Score plus Verteilung.
"severity": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": [
"routine",
"handle today",
"urgent",
"critical, about to churn"
]
}noul — kalibriertes Ja/Nein
Kein criteria — nur instructions. Wahrscheinlichkeit in [0, 1].
"escalate": {
"type": "noul",
"instructions": "Escalate to a human immediately?"
}4. Die Antwort
Typisierte Antworten: im Code verzweigen, kein JSON-in-String. Beispiel:
{
"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 wird vom Prepaid-Guthaben abgezogen. Output-Tokens sind gratis.
5. Limits & Praxis
- Rate ≈ 60/min pro Key (plus IP-/Konto-/Global-Caps).
- Weiche Burn-Caps ≈ 2.000.000 Tokens/Stunde und 20.000.000 Tokens/Tag pro Konto.
- State kürzen — Sie zahlen pro Input-Token.
- Mehrere Fragen in einem Call bündeln, um State-Kosten zu teilen.
- Confidence-/noul-Schwellen für einfache Fälle, Rest eskalieren.
Sofort starten
Anmelden, kleines Pack unter Preise kaufen, jv_live_ im Konto anlegen, Endpoint aufrufen. Eine Balance für Core decide und alle Tools.