Using a serverless channel for Jev decisions
A serverless channel is Jev invoked from a platform runtime (Vercel Function, Cloudflare Worker) where auth is often OIDC or env.AI, not a long-lived TYPESAFE_API_KEY in your laptop shell.
This is the platform-shaped half of the channel matrix, dated 2026-09-21. Independent unofficial notes. First-party contract remains docs.typesafe.ai. We do not sell keys.
Vercel AI Gateway + AI SDK (third-party)
Vercel’s KB (as fetched) uses model id typesafe-ai/jev and experimental_evaluate from the ai package. A string model id typically rides AI Gateway with the deployment’s OIDC token. Locally, Vercel documents that the token expires (~12 hours) — a 401 after vercel env pull goes stale is a Gateway auth failure, not a Jev schema bug.
import { experimental_evaluate as evaluate } from "ai";
const result = await evaluate({
model: "typesafe-ai/jev",
state: "The support agent issued a full refund to the customer.",
questions: {
refunded: {
type: "boolean",
instructions: "Was a refund issued?",
},
},
});
Gotcha: first-party HTTP uses type: "noul" and field noul. Gateway examples use type: "boolean". Do not mix. Vercel also documents a modelType: 'evaluationModel' error when the provider cannot resolve an evaluation model — check the id and that you are not hitting a chat-only compatibility endpoint.
Vendor price claim: Vercel’s Jev card lists $0.042 / 1M input, no output charge. Promotions and “customer verification required” gates are Vercel account issues. Treat them as callouts on errors, not a cloned error IA.
Cloudflare Workers AI (third-party)
const response = await env.AI.run("typesafe/jev", {
state: "Help! My payouts have been failing for 3 days.",
questions: {
is_urgent: {
type: "noul",
instructions: "Does this convey urgency?",
criteria: { true: "Explicitly time-sensitive", false: "No urgency expressed" },
},
},
});
CF’s card lists 32k context and dashboard pricing. REST from outside a Worker uses the input envelope — see REST channel.
When serverless is the wrong door
- You need TypeSafe’s 64k request budget as documented on the first-party models page — marketplace cards may be tighter.
- You must pin
jev-1.13.0and log that exact id. Gateway ids are often a family name (typesafe-ai/jev). - You want official SDK retries on 429/529 without writing them.
FAQ
Does a Worker replace TypeSafe waitlist? Only if that marketplace already provisioned Jev for your account. Access rules are the platform’s.
Can I keep one TypeScript client for Gateway and first-party? Share question design; do not share model ids or boolean/noul types.
Hub: Channels. Siblings: REST channel, getting started.
Sources
Public TypeSafe or adjacent documentation only. No private claims.