Quickstart

Jev API Quickstart — First Call in 3 Steps

From zero to a typed Jev response in about five minutes. No TypeSafe account required — call typesafe/jev-1.13 through OpenRouter and get probabilities you can branch on.

1

Get an OpenRouter API key

Create an account at OpenRouter and generate a key. Jev is available under the model ID typesafe/jev-1.13, so you don't need a separate TypeSafe signup.

export OPENROUTER_API_KEY="sk-or-..."
Tip: keep the key in an environment variable, not in your source.
2

Send your first request

The request body carries a state plus one or more questions. Here's a minimal curl example:

# Ask Jev to route a support ticket
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe/jev-1.13",
    "messages": [{
      "role": "user",
      "content": {
        "state": "I was charged twice for the same order #4821. Please fix this.",
        "questions": [{
          "type": "choice",
          "text": "Which team should handle this?",
          "options": ["billing", "tech_support", "sales"]
        }]
      }
    }]
  }'
3

Read the typed answer

Jev returns probabilities, not prose. Your code can branch on the result directly:

{
  "answers": [{
    "type": "choice",
    "text": "Which team should handle this?",
    "selected": "billing",
    "confidence": 0.94,
    "distribution": {
      "billing": 0.94,
      "tech_support": 0.04,
      "sales": 0.02
    }
  }]
}
Note: confidence is the top option's probability. Use a threshold (e.g. < 0.7) to route low-confidence cases to a human instead of guessing.

Where to go next

Browse the scene library for copy-paste-ready question configs, or read the model page on OpenRouter for the full parameter list.

Related guides