Zum Inhalt springen
Jev

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.

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).

curl
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?"
      }
    }
  }'

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:

3. Die drei Fragetypen

choice — eine Option wählen

criteria-Map mit Labels. Antwort: Gewinner-Key, Wahrscheinlichkeiten, Confidence.

choice
"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.

score
"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].

noul
"escalate": {
  "type": "noul",
  "instructions": "Escalate to a human immediately?"
}

4. Die Antwort

Typisierte Antworten: im Code verzweigen, kein JSON-in-String. Beispiel:

response
{
  "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

Sofort starten

Anmelden, kleines Pack unter Preise kaufen, jv_live_ im Konto anlegen, Endpoint aufrufen. Eine Balance für Core decide und alle Tools.