Jev API

Jev API: Quickstart and Examples

Understand the request shape, try a real classification, then copy a server-side integration example.

Never expose an AI Gateway key in browser-side code.

Quick answer

How does the Jev API work?

Send shared state plus a typed question and finite Choice options through the verified Vercel AI Gateway Evaluation endpoint. Read the selected answer and probabilities only when the provider returns them.

Try the request

State + question + choices.

AI TEXT CLASSIFIER2–10 labels
Categories

AI processing: Text submitted for classification may be sent to third-party AI services. Do not submit passwords, API keys, payment card data, health information, or other sensitive information. Privacy

Request examples

Keep the key on the server.

import { createGateway, experimental_evaluate as evaluate } from "ai";

const gateway = createGateway({ apiKey: process.env.AI_GATEWAY_API_KEY });
const result = await evaluate({
  model: gateway.evaluationModel("typesafe-ai/jev"),
  state: text,
  questions: {
    category: {
      type: "choice",
      instructions: "Classify the text into the best category.",
      criteria: { option_0: "Billing", option_1: "Technical", option_2: "Other" },
    },
  },
  maxRetries: 0,
});

Request anatomy

state

The text or structured context to evaluate.

questions

A map of typed decisions sharing the same state.

Choice

A finite option map; the result identifies the selected option.

Developer tool

Already know your categories?

Generate a TypeScript or Python starter from the same classification setup.

Open Code Generator →