Integrations / Vercel

Using Jev with Vercel AI Gateway and the AI SDK.

On Vercel, Jev is the AI Gateway model typesafe-ai/jev. Gateway accepts it through three interfaces: TypeSafe's own client, a plain HTTP endpoint, and the AI SDK. Separately, the AI SDK can skip Gateway and call TypeSafe directly with @ai-sdk/typesafe-ai.

Pick by what your code already uses. The interface decides the field names; the service decides the key, the model ID, and who bills you.

Which path to use

If you haveUseWhat changes
Existing @typesafe-ai/sdk codeTypeSafe-compatible Gateway routebaseURL and the API key. systemOne, noul, and response shapes stay.
An AI SDK app, or new TypeScript codeAI SDK experimental_evaluate via Gatewayai 7.0.105 or later and model: "typesafe-ai/jev". No extra provider package.
No AI SDK, or a non-TypeScript backendPOST /v1/evaluateSame model, state, and questions as the AI SDK, sent as JSON.
AI SDK code, but TypeSafe keys and billing instead of Vercel's@ai-sdk/typesafe-ai (not Gateway)TYPESAFE_AI_API_KEY and typeSafeAi.evaluationModel("jev-latest").

Vercel positions the TypeSafe-compatible route as a migration path. For new code it recommends the evaluation API, which is the same capability with neutral names.

Interface vs. service

Four paths, two services. The first three all end at Vercel AI Gateway (ai-gateway.vercel.sh); the fourth never touches it.

Path · your code callsService · endpointCredentialModel ID
TypeSafe SDK via Gateway
client.systemOne()
AI Gateway
/typesafe/v1/systemone
Gateway key or Vercel OIDCtypesafe-ai/jev
HTTP evaluation API
Any HTTP client
AI Gateway
/v1/evaluate
Gateway key or Vercel OIDCtypesafe-ai/jev
AI SDK via Gateway
experimental_evaluate()
AI Gateway
(AI SDK's own transport)
Gateway key or Vercel OIDCtypesafe-ai/jev
AI SDK direct
experimental_evaluate()
TypeSafe
api.typesafe.ai/v1
TypeSafe keyjev-latest
Two things people trip on. The last two rows share an interface, so the code is identical apart from the model line; billing, keys, and Gateway controls are not. And the two TypeSafe keys have different variable names: @typesafe-ai/sdk reads TYPESAFE_API_KEY, while @ai-sdk/typesafe-ai reads TYPESAFE_AI_API_KEY.

Contract differences

Gateway speaks two vocabularies for the same model. The TypeSafe-compatible route keeps TypeSafe's names; /v1/evaluate and the AI SDK (both Gateway and direct) use the evaluation API's names.

FieldTypeSafe-compatible (/typesafe)Evaluation API (/v1/evaluate, AI SDK)
Yes/no type"noul""boolean"
Yes/no answeranswers.x.noulanswers.x.probability
Choice optionscriteria: { label: description }criteria: { label: description }
Score rubriccriteria: [lowest, …, highest]criteria: [lowest, …, highest]
Choice answerchoice, probabilities, confidencechoice, probabilities (optional in the AI SDK types)
Choice/Score confidenceanswers.x.confidenceAI SDK: providerMetadata.typesafe.confidence.x. Not shown in Vercel's /v1/evaluate docs.
Usageusage.input_tokensusage.inputTokens
Gateway metadataprovider_metadata.gatewayproviderMetadata.gateway

Choice uses criteria on every path. There is no options array; the AI SDK types reject it.

Probability vs. confidence

PBoolean probability (.probability, or .noul on the TypeSafe route) is P(true). 0.02 is a confident no, not low confidence. Uncertainty sits near 0.5.
PChoice probability is the probability of one option: probabilities[choice] for the selected one.
CConfidence is TypeSafe's summary of how concentrated a Choice or Score distribution is, from 0 (spread evenly) to 1 (all on one option). Boolean answers have none. It is not the selected option's probability, and the AI SDK treats it as provider-specific.

Two results can give the leading option the same 0.54 and still differ in confidence. Set thresholds for each signal separately, on labeled examples from your workflow. Vercel's probabilities and thresholds guide ↗ covers this in depth.

TypeSafe SDK via Gateway

For existing @typesafe-ai/sdk code. Change the base URL and the key; the rest of the call is unchanged.

TypeScript · @typesafe-ai/sdk through AI Gateway
import { TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient({
  apiKey: process.env.AI_GATEWAY_API_KEY, // was TYPESAFE_API_KEY
  baseURL: "https://ai-gateway.vercel.sh/typesafe",
});

const result = await client.systemOne({
  model: "typesafe-ai/jev",
  state: "Apple Pay checkout fails on Safari for every customer since 09:40.",
  questions: {
    outage: {
      type: "noul",
      instructions: "Is this an active production outage?",
    },
    owner: {
      type: "choice",
      instructions: "Which team should own this ticket?",
      criteria: {
        payments: "Checkout, billing, and payment providers",
        frontend: "Browser and client-side bugs",
        support: "Account and non-technical requests",
      },
    },
  },
});

result.answers.outage.noul; // P(true), 0 to 1
result.answers.owner.choice; // "payments" | "frontend" | "support"
result.answers.owner.probabilities; // one probability per option
result.answers.owner.confidence; // TypeSafe confidence, inline

Vercel's API reference passes model: "typesafe-ai/jev". Its migration example omits model, in which case the SDK sends its default, jev-latest. Setting TYPESAFE_BASE_URL works in place of the baseURL option. The same route answers raw HTTP at POST /typesafe/v1/systemone and lists models at GET /typesafe/v1/models. Errors keep TypeSafe's message / error_type shape.

HTTP: POST /v1/evaluate

For any language, with no SDK. The body uses the evaluation API's names: boolean, choice, score, each with instructions and, where needed, criteria.

cURL · AI Gateway evaluation API
curl https://ai-gateway.vercel.sh/v1/evaluate \
  -H "Authorization: Bearer $AI_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe-ai/jev",
    "state": "Transaction $1,250. Billing, shipping, and IP country: US. Prior chargebacks: 0.",
    "questions": {
      "autoApprove": {
        "type": "boolean",
        "instructions": "Should this transaction be approved automatically?"
      },
      "risk": {
        "type": "choice",
        "instructions": "Which fraud-risk tier fits this transaction?",
        "criteria": {
          "minimal": "Consistent signals and clean history",
          "elevated": "One or more signals need review",
          "critical": "Strong indicators of fraud"
        }
      }
    },
    "providerOptions": {
      "gateway": { "zeroDataRetention": true }
    }
  }'

The response carries answers, usage, and Gateway routing and cost metadata:

Response shape (abridged)
{
  "model": "typesafe-ai/jev",
  "answers": {
    "autoApprove": { "type": "boolean", "probability": 0.93 },
    ...
  },
  "usage": { "inputTokens": 275, "outputTokens": 20 },
  "providerMetadata": {
    "gateway": { "routing": { ... }, "cost": "...", "generationId": "gen_..." }
  }
}

Boolean criteria ({ true, false }) is optional. Score criteria is an ordered array of at least two levels. state can be a string, object, or array.

AI SDK via Gateway

experimental_evaluate ships in ai 7.0.105 and later (pnpm add ai@latest). A plain model string resolves through AI Gateway, so no provider package is needed.

TypeScript · AI SDK through AI Gateway
import { experimental_evaluate as evaluate } from "ai";

const result = await evaluate({
  model: "typesafe-ai/jev",
  state: { plan: "Team", requestsLast60s: 14200, rateLimit: 5000 },
  questions: {
    abusive: {
      type: "boolean",
      instructions: "Does this traffic look like credential stuffing?",
    },
    action: {
      type: "choice",
      instructions: "What should happen to this account's traffic?",
      criteria: {
        allow: "A legitimate burst within tolerance",
        throttle: "Legitimate but over the limit",
        block: "Abusive traffic that should be rejected",
      },
    },
  },
  providerOptions: {
    gateway: { zeroDataRetention: true, disallowPromptTraining: true },
  },
});

const { abusive, action } = result.answers;
abusive.probability; // P(true), 0 to 1
action.choice; // "allow" | "throttle" | "block"
action.probabilities?.[action.choice]; // selected option's probability
result.providerMetadata?.typesafe?.confidence; // { action: number }

Answers keep your question IDs, and choice is typed as a union of your criteria keys. For an explicit provider instance, use gateway.evaluationModel("typesafe-ai/jev") from @ai-sdk/gateway. The AI SDK calls Gateway through its own transport, not /v1/evaluate; the question schema is the same. The API is experimental and may change in patch releases.

AI SDK direct to TypeSafe

@ai-sdk/typesafe-ai is the AI SDK's TypeSafe provider. Same interface as above, different service: requests go to api.typesafe.ai on your TypeSafe key, so Vercel's promotion, budgets, logs, and providerOptions.gateway do not apply.

TypeScript · @ai-sdk/typesafe-ai (no Gateway)
import { typeSafeAi } from "@ai-sdk/typesafe-ai";
import { experimental_evaluate as evaluate } from "ai";

const result = await evaluate({
  model: typeSafeAi.evaluationModel("jev-latest"), // TYPESAFE_AI_API_KEY
  state: { plan: "Team", requestsLast60s: 14200, rateLimit: 5000 },
  questions: {
    abusive: {
      type: "boolean",
      instructions: "Does this traffic look like credential stuffing?",
    },
  },
});

result.answers.abusive.probability; // same shape as the Gateway path

Install with pnpm add @ai-sdk/typesafe-ai ai. Model IDs are TypeSafe's (jev-latest, or a pinned version), not typesafe-ai/jev. createTypeSafeAi({ apiKey, baseURL }) overrides the key or the https://api.typesafe.ai/v1 default. The provider maps boolean to TypeSafe's noul and moves Choice/Score confidence to providerMetadata.typesafe.confidence. It defines no provider options yet. For TypeSafe's own client, see the TypeScript SDK guide; for keys and direct access, see API & access.

Authentication

01Gateway API key. AI_GATEWAY_API_KEY, sent as Authorization: Bearer. Works on all three Gateway paths; the AI SDK reads it automatically.
02Vercel OIDC. Vercel deployments get VERCEL_OIDC_TOKEN. The AI SDK uses it when no API key is set; for HTTP or the TypeSafe route, send it as the Bearer token. Locally, vercel link then vercel env pull; tokens last 12 hours.
03BYOK. Add a TypeSafe key under Gateway BYOK to keep Gateway routing but bill TypeSafe directly. You still authenticate to Gateway with 01 or 02.
04Direct provider. @ai-sdk/typesafe-ai takes a TypeSafe key only (TYPESAFE_AI_API_KEY). Gateway keys and OIDC tokens do not work there.

Privacy & observability

Vercel lists Jev with Zero Data Retention and No Training support. Both are per-request flags in providerOptions.gateway: zeroDataRetention: true and disallowPromptTraining: true. Vercel documents them for the AI SDK and /v1/evaluate, not for the TypeSafe-compatible route.

•Per-request ZDR is available on Pro and Enterprise at no extra cost. With ZDR on, Gateway skips BYOK keys unless you mark them ZDR-compliant.
•All three Gateway paths are billed through Gateway and show up in its usage, logs, custom reporting, and budgets alongside other model calls.

Pricing

As of September 23, 2026, Vercel's Jev model card ↗ shows Jev as Free, with promotional pricing ending September 25, 2026.

The card's underlying model data lists $0.042 per million input tokens and $0 output. Vercel does not label that figure as the post-promotion price, so check the card after September 25. The direct @ai-sdk/typesafe-ai path is billed by TypeSafe and is not covered by the Vercel promotion; see Jev pricing for TypeSafe's rates.

Code examples on this page were typechecked against ai 7.0.111, @ai-sdk/typesafe-ai 3.0.4, and @typesafe-ai/sdk 0.6.0, and run against mocked transports to confirm request URLs, bodies, and response access. They were not run against live endpoints.