← Use cases

Jev on Cloudflare

Unlike platforms where Jev is only reachable over plain HTTP, Cloudflare exposes it as a native partner model on Workers AI. Call env.AI.run('typesafe/jev', …) from a Worker and you get a typed answer — one of your options, a probability, a confidence — in a single parallel pass. No waitlist, no separate SDK, and the decision happens at the edge, right where your request already is.

Jev is TypeSafe AI's System One decision model: it reads state plus a set of typed questions and returns typed values with calibrated confidence in roughly 70–500ms, never free text. On Cloudflare that shape maps straight onto the Workers AI run() call, so a Worker can decide — route a ticket, gate a tool call, score a signup — inline in the same request it's already handling, without a round trip to a distant API.

Is Jev on Cloudflare Workers AI?

Call Jev from a Worker

Worker (env.AI) state + questions typesafe/jev Workers AI, at the edge typed answer + confidence one of your options
A Worker sends state + typed questions to typesafe/jev on Workers AI and gets back a typed answer with calibrated confidence — decided at the edge.

Bind Workers AI in your wrangler config, then call the model by id. There's no SDK to install — env.AI is already there.

# wrangler.toml — bind Workers AI into your Worker
[ai]
binding = "AI"   # exposes env.AI.run(...)
// src/index.js — decide which queue a ticket goes to, at the edge
export default {
  async fetch(request, env) {
    const ticket = await request.text();

    const response = await env.AI.run('typesafe/jev', {
      state: ticket,
      questions: {
        queue: {
          type: 'choice',
          instructions: 'Which queue should this ticket go to?',
          criteria: {
            billing: 'payments, refunds, invoices',
            technical: 'bugs, errors, how-to',
            abuse: 'spam, fraud, policy violations',
            sales: 'pricing, upgrades, new purchases',
          },
        },
      },
    });

    // response.answers.queue.choice is locked to one of your four keys,
    // with a calibrated confidence you can threshold for a safe fallback.
    return Response.json(response);
  },
};

The answer for each question comes back as one of the criteria keys you defined — never a made-up label — plus a confidence value. Threshold on that confidence to fall back to a safe default when Jev isn't sure, and pin a model version so the number stays stable as models update. The whole decision is sub-cent and runs in ~70–500ms, cheap enough to put in front of every request.

Two ways to reach Jev on Cloudflare

The Workers AI binding is the zero-setup path and bills through your Cloudflare Workers AI usage like any other partner model. If you'd rather keep decisions on your own TypeSafe account — or you're calling from outside Workers AI — any Worker can also POST the hosted endpoint directly with a jv_live_ key, and you can put a Cloudflare AI Gateway in front of that call for caching, rate-limiting and analytics.

Workers AI bindingfetch + jv_live_ (optionally via AI Gateway)
Howenv.AI.run('typesafe/jev', …)fetch('https://jevtypesafeai.com/api/v1/decide', …)
SetupJust the [ai] bindingA jv_live_ key in a secret
Billed toYour Workers AI usageYour TypeSafe / Jev account
Caching & analyticsWorkers AI defaultsAdd an AI Gateway in front
// Any Worker, no Workers AI binding — call the hosted API directly.
// Put a Cloudflare AI Gateway in front of this URL to cache + observe it.
const r = await fetch('https://jevtypesafeai.com/api/v1/decide', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${env.JEV_API_KEY}`, // jv_live_... stored as a secret
  },
  body: JSON.stringify({ state: ticket, questions: { /* same shape as above */ } }),
});
const { answers } = await r.json();
const queue = answers.queue.choice;          // one of your criteria keys
const conf = answers.queue.confidence;       // threshold this

A cacheable decision API at the edge

Decisions are often repeated — the same spammy comment, the same routing question — so caching them at the edge is a real win. A good community example is jev-worker: a Worker that exposes Jev as a small HTTP decision API, validates requests and model responses, routes answers by confidence, and caches successful inference in Workers KV, with a few editable presets (form-spam, comment moderation, lead quality, support routing). It's an independent, MIT-licensed project — not TypeSafe and not us — but it's a clean blueprint for a cached edge decision service.

Why decide at the edge

Call a frontier LLMJev on Workers AI
JobGenerate text / reasonPick one option, score, or judge
OutputTokens to parseOne typed value + confidence
WhereA distant API round tripAt the edge, in-request
LatencyThe model's (often seconds)~70–500ms
ReliabilityMay drift / hallucinate0% structured-output error
Cost per stepFrontier-model tokensUnder a cent per decision

Sources

FAQ

Is Jev available on Cloudflare Workers AI?

Yes. Jev is a partner model on Workers AI with the id typesafe/jev — you call it with the standard env.AI.run() binding, no waitlist. It's a third-party model Cloudflare hosts access to, not one Cloudflare built; the weights and calibration are TypeSafe's.

How do I call Jev from a Cloudflare Worker?

Add an [ai] binding in wrangler.toml, then call env.AI.run('typesafe/jev', { state, questions }). Each question comes back as one typed answer — a choice, score, or noul — plus a calibrated confidence. No SDK to install; env.AI is already available in the Worker.

Do I need a TypeSafe (jv_live_) API key to use Jev on Cloudflare?

Not for the Workers AI binding — that bills through your Cloudflare Workers AI usage. You only need a jv_live_ key if you call the hosted TypeSafe endpoint directly with fetch (for example to keep billing on your own TypeSafe account, or from outside Workers AI).

Can I cache Jev decisions on Cloudflare?

Yes. Repeated decisions cache well: you can store successful results in Workers KV yourself (the community jev-worker does exactly this), or put a Cloudflare AI Gateway in front of a direct fetch to add caching, rate-limiting and analytics.

What does a Jev decision cost on Cloudflare?

A single decision is well under a cent and runs in ~70–500ms. The Workers AI binding bills through your Cloudflare usage; a direct fetch bills to your TypeSafe account, where we charge per input token on a sliding scale (larger top-ups are cheaper) with output free. Exact numbers live on the pricing page.

See also: Cloudflare docs: typesafe/jev · Jev on AWS Bedrock · Jev over MCP · How to use the Jev API · Pricing

Put a typed decision at the edge

Call typesafe/jev from a Worker, or grab a jv_live_ key and POST the hosted endpoint from anywhere. One sub-cent call, one calibrated answer back.

▶ Try Jev freeGet an API key →
Jev on Cloudflare — Workers AI binding & edge decisions · Jev by TypeSafe AI