Start building

Official

Jev Quickstart

Go from API key to a typed Jev decision your application can branch on in about five minutes.

Follow one support ticket through a Choice question, read the selected category, then route it in your own code. These are server-side examples; this page never asks for your key or calls the API.

API key to application branch

Your first Jev decision

Use the same ticket in every language: “I was charged twice this month. Please help.” Ask “What is this ticket about?” with billing, technical, and other as the possible answers. Select a language once; the entire coding flow changes with it.

TypeScript path · Node.js 20 or newer

  1. 01

    Install

    Install the JavaScript SDK

    The official package includes TypeScript declarations. Run the example in your server-side Node.js application.

    TypeScript
    npm install @typesafe-ai/sdk

  2. 02

    API key

    Set your API key

    Create a key in the TypeSafe dashboard when your account has API access. Keep it in your server environment, never in browser code.

    TypeScript
    export TYPESAFE_API_KEY="YOUR_KEY"

  3. 03

    First Jev decision

    Ask one Choice question

    The SDK reads TYPESAFE_API_KEY and uses jev-latest by default. The question ID is category; its answer returns under the same ID.

    TypeScript
    import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
    
    const ticket = "I was charged twice this month. Please help.";
    const client = new TypeSafeClient();
    
    const response = await client.systemOne({
      state: ticket,
      questions: {
        category: choice("What is this ticket about?", {
          billing: null,
          technical: null,
          other: null,
        }),
      },
    });

  4. 04

    Read the typed result

    Read the typed result

    A Choice answer contains choice, probabilities, and confidence. Here billing is an illustrative outcome; your actual result may differ.

    TypeScript
    const category = response.answers.category.choice;
    // Example: "billing"

  5. 05

    Use the decision in your application

    Route the ticket in application code

    Replace these handler names with your application's own functions. Keep routing policy in code.

    TypeScript
    switch (category) {
      case "billing":
        await handleBilling(ticket);
        break;
      case "technical":
        await handleTechnical(ticket);
        break;
      default:
        await handleGeneral(ticket);
    }

Illustrative

“billing” is an example outcome for this ticket, not a guaranteed result or a live run. Check the returned value and confidence before automating consequential actions.

What you send to Jev

state

The information Jev judges. It can be text or structured data, such as a ticket record. It is not a chat prompt asking Jev to write a reply.

{
  "ticket": {
    "message": "I was charged twice this month. Please help."
  }
}

questions

The narrow typed judgments to make about that state. One request can include several independent questions. Keep ordinary deterministic business rules in application code.

state → Choice question → typed answer → your branch

Add more focused decisions

The first call uses Choice. For the same ticket, you could also ask a Score question for urgency and a Noul yes/no question for human review. Each answer is independent, and your code decides how to combine them.

Choice

Ticket category

Which known category fits this ticket?

Score

Urgency

Where does this ticket fall on your urgency scale?

Noul

Human review

Does this ticket need a human review?

One state → Choice + Score + Noul → code

Build a Decision Schema

Plan questions with JevKit’s generic builder. Its output is not an official Jev API payload.

Common API errors

401
Check that TYPESAFE_API_KEY is set and the Bearer token is valid.
422
Check required fields and the shape of your Choice criteria.
429
You reached a rate limit. Back off before retrying.
529
TypeSafe is temporarily overloaded. Retry after a short delay.

TypeSafe SDKs retry 429 and 529 by default. For direct HTTP calls, retry with backoff.

Evidence

Official API details, independent guide

JevKit is an independent site. SDK calls, the HTTP endpoint, and answer fields are verified against TypeSafe documentation. The ticket and routing policy are illustrative.

Last verified:

Sources

Next step

Design your next decision

Choose the questions and allowed answers your workflow needs, then connect them to your own application logic. The builder makes a generic planning schema, not an API payload.