Skip to content
Jev

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.

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

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

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:

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.

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 on a scale

Pass an ordered criteria array (2–10 levels). Response returns a numeric score plus the distribution over levels.

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

noul
"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:

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 is what we deduct from your prepaid balance. Output tokens are free.

5. Limits & practices

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.