Start here / Access & setup · Beginner
How to use Jev AI: API access and your first request.
This is the path from “what is this” to a working call: get access to TypeSafe's Jev model, install the SDK, and classify one real message. Prefer to try it without an account or any code first? Explore the interactive demo on the homepage — no setup required.
Prerequisites
- A TypeSafe account with API access to Jev — see “Getting API access” below.
- An API key from the TypeSafe console.
- Node.js 20 or newer, and a place to set a server-side environment variable.
- Billing set up for paid usage past any trial allowance — TypeSafe publishes per-token pricing (see “Cost and access questions” below), but we could not verify from public docs alone whether a payment method must be added before your very first request succeeds. Check your own console account.
Getting API access
TypeSafe's marketing site currently describes Jev as an early-access model. Sign in at the TypeSafe console with Google or an emailed one-time code — that sign-in page is the only access step we could see publicly, with no separate waitlist form. Once signed in, create a key on the Keys page.
What we could not verify: whether every account gets immediate API access or some require additional approval, and any approval-time estimate. Nothing public states this either way — check your own account's status directly rather than trusting an assumption here.
Secure setup
Install the official SDK: npm install @typesafe-ai/sdk
Set TYPESAFE_API_KEY as a server-side environment variable — an .env file listed in .gitignore, or your platform's secret manager. new TypeSafeClient() reads it automatically, so you never write the key as a literal. Keep this call on a server: the SDK's dangerouslyAllowBrowser option, which would let it run in browser code and expose your key to every visitor, defaults to false for exactly this reason.
Your first request
This sends one customer message to Jev and asks it to choose which of five departments should handle it — the same request behind the homepage demo and the message-routing recipe.
// Recipe: Route a message — classify a customer message into a department with Jev.
// Requires Node.js 20+ and TYPESAFE_API_KEY in the environment.
// npm install @typesafe-ai/sdk
// Generated from the same code path as the live example on /recipes/message-routing;
// see scripts/generate-recipe-examples.mts. Not executed against the live API by this guide.
import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient(); // reads TYPESAFE_API_KEY, defaults to jev-latest
const message = "Hi, I was charged twice for my subscription this month. The two charges show up on my card statement on the 3rd and the 4th. Can you refund one of them?";
const { answers } = await client.systemOne({
state: message,
model: "jev-latest",
questions: {
department: choice(
"Which department should handle this customer message?",
{
billing: "Charges, invoices, refunds, payment methods, subscription costs",
account: "Login, password, profile, permissions, closing or changing an account",
technical: "Bugs, errors, outages, integrations, something not working",
sales: "Pricing questions, plan comparisons, upgrades, purchasing for a team",
other: "Anything that does not fit the departments above",
},
),
},
});
const { choice: result, probabilities, confidence } = answers.department;
// Your code decides what to do with the answer.
if (confidence < 0.5) {
console.log("Unsure. Route to a person.", probabilities);
} else {
console.log("Route to " + result + " (confidence " + confidence.toFixed(2) + ")");
}Understanding the response
answers.department.probabilities gives one number per department; the API documents that they sum to 1. confidence is a separate, single statistic TypeSafe derives from the shape of that distribution — its own docs put it plainly: “all of it on one option gives 1.0; the more evenly it spreads, the lower the confidence.” It is not one of the probabilities, and it is not a guarantee that the chosen department is correct.
// Illustrative — shape and typical field names, not a response captured from a live call.
const response = {
model: "jev-1.13.0",
answers: {
department: {
choice: "billing",
probabilities: { billing: 0.82, account: 0.06, technical: 0.05, sales: 0.03, other: 0.04 },
confidence: 0.73,
},
},
usage: { input_tokens: 148, output_tokens: 12 },
};usage.input_tokens and usage.output_tokens report the token counts billed for that call — see “Cost and access questions” for what that costs.
Cost and access questions
- Does using the API require payment?
- Yes. TypeSafe bills API usage per token — as of this review, published pricing for Jev is $42 per billion input tokens ($0.042 per million); output tokens are documented as free. We could not verify whether new accounts receive any free trial credit.
- Is API usage different from a subscription to this website?
- Yes. Jev Guide is an independent, free resource with no subscription of its own. Calling the TypeSafe API is billed by TypeSafe directly through your own TypeSafe account, entirely separate from this site.
- What contributes to request cost?
- Mainly input tokens: the
stateyou send plus your question's instructions and criteria. Output tokens are currently documented as free. Pricing and rate limits can change without notice — TypeSafe's own docs say so explicitly — so check docs.typesafe.ai/models for current numbers before relying on this page for budgeting.
Reviewed against official sources in September 2026.
Troubleshooting
The HTTP API returns a JSON body describing what went wrong, and @typesafe-ai/sdk throws a typed error subclass for each — AuthenticationError, UnprocessableEntityError, RateLimitError, and InternalServerError — so you can catch and branch with instanceof. See the TypeScript guide's error-handling example for working code.
- 401 Unauthorized
- Missing or invalid API key. Check the Authorization header and TYPESAFE_API_KEY.
- 422 Unprocessable Entity
- The request body failed validation — for example a missing field or malformed question.
- 429 Too Many Requests
- Rate limit exceeded. The official SDKs retry this with backoff by default.
- 529 Overloaded
- TypeSafe is temporarily overloaded. The official SDKs retry this with backoff by default.
Next steps
- Implement this in a TypeScript app — department criteria, typed response handling, and error handling in full.
- Try this exact request live in the interactive recipe, with your own message.
- Official TypeSafe documentation
Sources and verification
- Quickstart — the API-key link and first-request shape.
- Models — model ids, pricing, rate limits, and input limits.
- Confidence — how it is derived from the probability distribution.
- HTTP API reference — request/response fields and the error table above.
- TypeSafe console — sign-in and API keys.
- @typesafe-ai/sdk on GitHub — pinned at v0.6.0 in this site's package.json.
Reviewed against the sources above in September 2026. The example is compiled by this site's TypeScript build against SDK 0.6.0; its request shape matches the API reference cited above. No TypeSafe API key is configured in this environment, so this guide has not executed the example against the live API — passing a type check confirms the code compiles, not that it runs.