No self-built relay
Skip custom “Jev proxy” services. Point your app or serverless function at Gateway directly.
Use AI Gateway as the only network hop. Do not stand up your own proxy or “relay” API for Jev. Evaluation requires the AI SDK evaluate API (AI SDK 7+).
npm install ai @ai-sdk/gateway import { experimental_evaluate as evaluate } from 'ai';
const result = await evaluate({
model: 'typesafe-ai/jev',
state: 'In stock? Can you ship to the US?',
questions: {
label: {
type: 'choice',
instructions: 'Label this livestream comment for the host team.',
criteria: {
buy_intent: 'Purchase intent, stock availability, or shipping destination questions tied to buying',
price_question: 'Asking about price, discounts, bundles, or deal terms',
after_sales: 'Post-purchase support, returns, defects, delivery problems after buying',
spam: 'Bots, ads, scams, harassment, or irrelevant promotional noise',
other: 'Does not fit the above',
},
},
},
});
// result.answers.label.choice → e.g. "buy_intent"
// high confidence → auto-suggest; low → human queue const result = await evaluate({
model: 'typesafe-ai/jev',
state: 'API returns 500 on checkout',
questions: {
route: {
type: 'choice',
instructions: 'Route this support ticket to the right queue.',
criteria: {
tech: 'Bugs, outages, errors, API failures, integrations, or product not working as designed',
sales: 'Pricing, plans, upgrades, demos, or new-purchase intent before becoming a customer',
billing: 'Charges, invoices, receipts, subscriptions, payment method, or invoice questions',
human: 'Ambiguous, multi-issue, sensitive, legal, account takeover, or otherwise needs a person',
},
},
},
});
// → tech Skip custom “Jev proxy” services. Point your app or serverless function at Gateway directly.
Suggestions only. Refunds and payment capture stay human-owned — out of scope for this pack.