Skip to content
Jev Hub

[ Getting started ]

How to use Jev:
your first API call.

The Jev API takes an input and the questions you want answered, and returns an answer for each, with probabilities and a confidence score. Try it in the browser playground, call the API directly, use the Python SDK, or add it to Claude Code, Codex or OpenCode.

Updated By Jev Hub

How do you make your first Jev call?

TypeSafe AI documents four routes in its quick start (opens in a new tab). Pick the one that matches how you work:

  • The playground. Paste an input, add a question and see the result in the browser. No code and the fastest way to test an idea. Open the playground (opens in a new tab).
  • The HTTP API. One POST request to https://api.typesafe.ai/v1/systemone with your key as a Bearer token.
  • The Python SDK. Install it with the command below (Python 3.10 or later). The client reads TYPESAFE_API_KEY from the environment and calls jev-latest by default.
    Terminal
    pip install typesafe-sdk
  • The agent skill. If a coding agent is writing the integration, TypeSafe publishes a skill that teaches it the API. Install it with the command below.
    Terminal
    npx skills add typesafe-ai/skills --skill typesafe-ai
IF YOU WANT TOUSETest an idea, no codeThe playgroundin the browserSend one HTTP requestThe HTTP APIPOST /v1/systemoneWrite it in PythonThe Python SDKPython 3.10+Let a coding agent build itThe agent skillnpx skills add
Pick your route. The four ways TypeSafe's quick start documents. All of them call the same model; they differ in how much code you write.

The steps below use the API and the SDK, with one example: sorting an incoming email.

Step 1: Write your questions

A request has three parts: the state (the input to evaluate), the model, and a map of questions. Each question is one of three types:

  • Choice picks one option from a set you define, as a map of option name to description.
  • Score places the input on an ordered scale you describe in words.
  • Noul returns the probability that a yes/no statement is true.

Two details from TypeSafe's Choice docs (opens in a new tab) save a lot of debugging. The question ID you choose (category below) is never shown to the model, so the full question must be in instructions. And both the option names and their descriptions are sent, so write descriptions that clearly separate one option from another.

request.json
{
  "model": "jev-latest",
  "state": "From: Dana Lee <dana@acme.io>\nSubject: Invoice #4471 charged twice\nBody: Our card was charged twice for March. Can you refund the duplicate today? Our finance close is tomorrow.",
  "questions": {
    "category": {
      "type": "choice",
      "instructions": "What kind of email is this?",
      "criteria": {
        "needs_reply": "A person expecting a response from us",
        "updates": "Notifications, receipts, product updates",
        "promotions": "Marketing and newsletters",
        "spam": "Unwanted or suspicious mail"
      }
    },
    "needs_human": {
      "type": "noul",
      "instructions": "Does this email involve money, legal risk or an upset customer?"
    }
  }
}

Step 2: Call the API

Send the request with your key. Get the key from TypeSafe's dashboard, as described in the quick start.

Shell
curl -X POST https://api.typesafe.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json

Step 3: Read the response

Each answer is returned under the question ID you chose. The values below are illustrative; the shape follows TypeSafe's API.

Response (abridged)
{
  "model": "jev-1.13.0",
  "answers": {
    "category": {
      "type": "choice",
      "choice": "needs_reply",
      "confidence": 0.84,
      "probabilities": { "needs_reply": 0.91, "updates": 0.05, "promotions": 0.03, "spam": 0.01 }
    },
    "needs_human": { "type": "noul", "noul": 0.88 }
  },
  "usage": { "input_tokens": 212, "output_tokens": 31 }
}
  • choice is the selected option, and probabilities gives one probability per option.
  • confidence collapses the shape of those probabilities into a single number from 0 to 1: 1 when all the probability sits on one option, 0 when it is spread evenly. Score answers carry a score, a legend of your levels and a confidence too.
  • noul is the probability that the statement is true. Noul answers don't carry a confidence value.
  • usage reports input tokens, which is what you're billed for.

Step 4: Turn confidence into rules

This is where Jev earns its keep. TypeSafe's confidence guide (opens in a new tab) suggests three paths: act automatically when confidence is high, proceed with care or ask for confirmation in the middle, and route to a person or a stronger model when it is low. It uses 0.5 as a floor, and says thresholds should scale with the cost of being wrong, so a destructive action needs a higher bar than a read-only one. It also advises starting conservative and testing on your own data.

WHEN CONFIDENCE ISTHENHighAct automaticallyIn the middleProceed with careor ask to confirmLow (below 0.5)Route it onto a person or bigger model
Three paths by confidence. TypeSafe's confidence guide uses 0.5 as a floor and says thresholds should rise with the cost of being wrong. Set them on a sample of your own data.
Python
from typesafe_sdk import Choice, Noul, TypeSafeClient

client = TypeSafeClient()  # reads TYPESAFE_API_KEY from the environment

response = client.system_one(
    state=email_text,
    questions={
        "category": Choice(
            instructions="What kind of email is this?",
            criteria={
                "needs_reply": "A person expecting a response from us",
                "updates": "Notifications, receipts, product updates",
                "promotions": "Marketing and newsletters",
                "spam": "Unwanted or suspicious mail",
            },
        ),
        "needs_human": Noul(instructions="Does this email involve money, legal risk or an upset customer?"),
    },
)

category = response.answers["category"]
if category.confidence < 0.5:
    route_to_human(email_text)   # the model is genuinely unsure
elif category.choice == "spam":
    archive(email_text)
else:
    label(email_text, category.choice)

Step 5: Keep the cost down

  • Batch your questions. Questions about the same input go in one request, so the input is read once.
  • Send only what the decision needs. Input length is the biggest lever. An email's subject and first few hundred words usually decide the category.
  • Price it first. The cost calculator estimates a monthly bill from volume, item length and questions per item.

Where else can you use Jev?

Besides TypeSafe's own API, Jev is available through the Vercel AI Gateway, OpenRouter and LiteLLM.

What should you build first with Jev?

Pick a decision a person currently makes over and over: which team gets this ticket, does this lead deserve a call, is this post spam. The use cases show the questions and the cost for each. For how Jev differs from a language model, read Jev vs ChatGPT and Claude.

Common questions