Integrations / Vercel

Using Jev via Vercel AI Gateway.

Vercel AI Gateway supports TypeSafe Jev under model identifier typesafe-ai/jev through three distinct integration patterns: the official TypeSafe client adapter, a direct HTTP evaluation endpoint, and the Vercel AI SDK.

Routing Jev through Vercel provides centralized API key management via AI_GATEWAY_API_KEY, consolidated Vercel platform billing, and built-in observability without requiring separate credentials from TypeSafe.

The Three Documented Access Patterns

Depending on your architecture and existing dependencies, Vercel provides three supported integration pathways for Jev:

01Existing TypeSafe client: Uses the official @typesafe-ai/sdk package, pointing its base URL to https://ai-gateway.vercel.sh/typesafe while authenticating with your Vercel gateway key. This route preserves TypeSafe's native question vocabulary (including noul).
02Vercel AI Gateway HTTP evaluation API: Sends standard REST POST requests directly to https://ai-gateway.vercel.sh/v1/evaluate with model string typesafe-ai/jev, accepting a keyed questions object using Vercel's native types (boolean, choice, score).
03Vercel AI SDK (ai): Uses the experimental_evaluate method exported directly by the core ai package, specifying typesafe-ai/jev and reading evaluated outputs directly from result.answers.

Which Route Should You Use?

Integration PatternPackage / EndpointBest Suited ForQuestion Vocabulary
TypeSafe SDK Client@typesafe-ai/sdk
baseURL: .../typesafe
Teams with existing TypeSafe code needing fully-typed response schemas with Vercel observability. Reads answers from result.answers.noul, choice, score (with criteria)
HTTP Evaluation APIPOST /v1/evaluateMicroservices, edge runtimes, curl scripts, Python backends, or languages without dedicated TypeScript SDKs.boolean, choice, score (with instructions)
Vercel AI SDKimport { experimental_evaluate } from "ai"Next.js applications already using Vercel AI SDK for LLMs, wanting unified telemetry, middleware, and tracing. Reads from result.answers.boolean, choice, score (with instructions)
Vocabulary difference note: The TypeSafe-compatible client route (/typesafe) and Vercel-native evaluation route (/v1/evaluate and AI SDK experimental_evaluate) expose slightly different question vocabulary even though both route to Jev. Specifically, the TypeSafe client pathway uses TypeSafe's native primitives (including noul for binary propositions with continuous probability), whereas the native Vercel evaluation API and AI SDK expose boolean, choice, and score types with instructions.

Pattern 1: TypeSafe SDK with Vercel Base URL

If you already use @typesafe-ai/sdk, you can redirect all inference traffic through Vercel AI Gateway by setting baseURL: "https://ai-gateway.vercel.sh/typesafe" and authenticating with your Vercel gateway key:

TypeScript (@typesafe-ai/sdk with Vercel Gateway)
import { TypeSafeClient } from "@typesafe-ai/sdk";

// Route standard TypeSafe SDK calls through Vercel AI Gateway
const client = new TypeSafeClient({
  apiKey: process.env.AI_GATEWAY_API_KEY!,
  baseURL: "https://ai-gateway.vercel.sh/typesafe",
});

async function runGatewayEvaluation() {
  const result = await client.systemOne({
    model: "jev-latest",
    state: "User feedback: 'Checkout crashed when clicking Pay with Apple Pay on Safari iOS 18.' User plan: Enterprise. Severity: High.",
    questions: {
      triage_queue: {
        type: "choice",
        instructions: "Assign engineering incident triage queue",
        criteria: {
          payments_eng: "Payments, checkout, and billing gateways",
          ios_frontend: "Safari, WebKit, and mobile iOS client bugs",
          api_gateway: "Backend routing, edge proxy, and 5xx errors",
          customer_support: "Account issues and non-technical customer tickets"
        }
      },
      is_outage: {
        type: "noul",
        instructions: "This report indicates an active production payment outage."
      }
    }
  });

  console.log("Queue:", result.answers.triage_queue.choice);
  console.log("Outage Probability:", result.answers.is_outage.noul);
}

runGatewayEvaluation();

Pattern 2: Vercel AI Gateway HTTP Evaluation API

For zero-dependency REST integrations, Vercel AI Gateway exposes a dedicated evaluation endpoint at POST https://ai-gateway.vercel.sh/v1/evaluate:

cURL (Vercel AI Gateway HTTP Evaluation API)
curl -X POST "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: Amount $1,250. Billing country: US. Shipping country: US. IP address country: US. Previous chargebacks: 0.",
    "questions": {
      "fraud_risk": {
        "type": "choice",
        "instructions": "Evaluate transaction fraud risk category",
        "options": ["minimal", "elevated", "critical"]
      },
      "auto_approve": {
        "type": "boolean",
        "instructions": "Should this transaction be automatically approved?"
      }
    }
  }'

Pattern 3: Vercel AI SDK (experimental_evaluate)

When developing in Next.js or Node.js environments with the Vercel AI SDK, invoke Jev using the experimental_evaluate export from ai:

TypeScript (Vercel AI SDK experimental_evaluate)
import { experimental_evaluate as evaluate } from "ai";

// Standard Vercel AI SDK pattern using model string 'typesafe-ai/jev'
async function evaluateWithAiSdk() {
  const result = await evaluate({
    model: "typesafe-ai/jev",
    state: "Account ID: 8941. API requests in last 60s: 14,200. Concurrency limit: 5,000. Plan: Team.",
    questions: {
      rate_limit_action: {
        type: "choice",
        instructions: "Determine gateway throttling policy",
        options: ["allow", "queue", "drop_with_429"]
      },
      abuse_flag: {
        type: "boolean",
        instructions: "Does this traffic spike exhibit credential stuffing or DoS characteristics?"
      }
    }
  });

  console.log("Decision answers:", result.answers);
  console.log("Rate limit action:", result.answers.rate_limit_action);
  console.log("Abuse boolean:", result.answers.abuse_flag);
}

evaluateWithAiSdk();

Authentication & Environment Setup

All requests through Vercel AI Gateway authenticate using the standard gateway environment variable:

Environment Variable: Set AI_GATEWAY_API_KEY in your project settings or .env.local. (Do not confuse this with unverified alternative key names.)
Vercel Deployment: When deployed on Vercel, the AI Gateway key can be populated automatically via your team dashboard integration settings.
Model Slug: Across all Vercel gateway evaluation endpoints and AI SDK calls, the canonical model string is typesafe-ai/jev.

Billing & Pricing

Vercel currently lists Jev as Free under a promotion ending September 25, 2026. Outside promotional pricing, consult Vercel's live Vercel Jev model card ↗ and TypeSafe's direct pricing.

Promotional Status: Free tier evaluation on Vercel AI Gateway under promotional pricing ending September 25, 2026.
Baseline Token Rates: Outside gateway promotions, direct TypeSafe pricing is $0.042 per 1,000,000 input tokens ($0.000042 per 1k tokens), with $0.00 output token billing because Jev returns structured evaluation objects rather than generative text strings.

Refer to the live Vercel Jev model card ↗ for current post-promotion billing details, or check our Jev Pricing Reference.

Not affiliated with, endorsed by, or operated by TypeSafe AI. Vendor claims are cited and attributed.