← Use cases

Using Jev from TypeScript

TypeSafe AI means the type safety reaches all the way into your TypeScript. You define the options, and Jev returns one of them — never free text, never an invalid label — so the response lines up with your types instead of fighting them.

Jev is TypeSafe AI's first System One model. A call is a model plus state plus a map of questions, and each question is constrained to the options you declare. From TypeScript that is a perfect fit: the keys you send are the only keys you can get back, so you can type the response once and trust it everywhere.

A typed decide call

type Verdict = "approve" | "review" | "reject";

const res = await fetch("https://jevtypesafeai.com/api/v1/decide", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${process.env.JEV_KEY}`, // jv_live_...
  },
  body: JSON.stringify({
    state: { text: input },
    questions: {
      verdict: { type: "choice", options: ["approve", "review", "reject"] },
    },
  }),
});

const data = (await res.json()) as {
  verdict: { key: Verdict; probs: Record<Verdict, number>; confidence: number };
};

if (data.verdict.confidence > 0.8) act(data.verdict.key);

Because verdict.key is one of your literal options, TypeScript narrows it for you — the switch is exhaustive, and there is no branch for a label the model invented, because it can't invent one.

Why this beats parsing an LLM reply

Prompting an LLM from TypeScript leaves you casting a string, validating it, and handling the case where the model returned prose instead of JSON. Jev removes that layer entirely: the output is locked to your enumeration, arrives in roughly 70–500ms, costs about $0.001 per decision, and comes with calibrated probabilities from RLCD training so you can gate on confidence.

Get a key

Create a jv_live_ key from the dashboard and drop it in an env var. The endpoint above is the hosted TypeSafe AI gateway; the official upstream is POST https://api.typesafe.ai/v1/systemone with the same shape.

See also: How to use the API · Docs · Get an API key

Call Jev from TypeScript

Grab a jv_live_ key and get a fully typed decision in one fetch.

▶ Try Jev freeGet an API key →
Jev + TypeScript — typed AI decisions with no parsing · Jev by TypeSafe AI