Jev Getting Started — Install, First Call & Limits
Install the TypeSafe SDK, make your first Jev decision with Noul, Choice, and Score, and learn the model aliases, size limits, and error codes.
Getting Started with Jev
Jev is reached through a single endpoint: POST https://api.typesafe.ai/v1/systemone, authenticated with a Bearer key. Official SDKs wrap that call with typed helpers for the three primitives. Everything you send is one state plus a dictionary of questions; everything you get back is one answer per question.
This page covers installation, a first call in TypeScript and Python, the primitives, and the limits worth knowing before you build. Read Prompt Engineering next — most of the quality comes from how you write the questions, not the code.
Install the SDK
npm install @typesafe-ai/sdk
The JavaScript SDK targets Node 20+ and ships ESM, CJS, and type definitions. Keep the API key server-side — the SDK blocks browser use on purpose.
Export your key before you run anything:
export TYPESAFE_API_KEY="your-key"
Your First Decision
A support ticket is a good first state: it has free text, a small set of departments, and a severity that maps to ordered levels. All three primitives fit in one call.
import { TypeSafeClient, noul, choice, score } from '@typesafe-ai/sdk'
const client = new TypeSafeClient({
apiKey: process.env.TYPESAFE_API_KEY,
defaultModel: 'jev-1.13.0',
})
const state = {
ticket_message:
'My card was charged twice for order A-104. Please refund the duplicate.',
order: { id: 'A-104', charges: [49, 49] },
refund_policy: 'Duplicate charges are eligible for a full refund.',
}
const { answers, model, usage } = await client.systemOne({
state,
questions: {
refund_requested: noul('Does `ticket_message` request a refund?'),
department: choice('Which team should handle this?', {
billing: 'Charges, invoices, refunds, subscriptions',
technical: 'Bugs, outages, integration problems',
other: 'None of the above',
}),
severity: score('How severe is the reported issue?', [
'Cosmetic, no functional impact',
'Degraded, a workaround exists',
'Blocking, cannot complete the task',
]),
},
})
console.log(model, usage)
console.log(answers.department.choice, answers.department.confidence)
Each answer carries a type. A Noul answer exposes noul; a Choice answer exposes choice, probabilities, and confidence; a Score answer exposes score, legend, probabilities, and confidence.
Decisions are advisory:
A schema-valid answer can still be the wrong answer. Combine the probabilities with your own thresholds in code, and never auto-execute a destructive action on a returned choice alone.The Three Primitives
| Primitive | Question it answers | Returns |
|---|---|---|
| Noul | Is this true? | A probability from 0 to 1. There is no separate confidence field — the probability is the only signal. |
| Choice | Which one of these? | choice, a full probabilities distribution over your options, and confidence. Up to 255 options. |
| Score | Where on this scale? | score, the legend, probabilities, and confidence. The score is the probability-weighted mean of the level numbers, so it can land between levels. Between 2 and 10 levels. |
Two consequences of those definitions:
- A Noul at 0.5 means "can't tell," not "medium." To measure a degree, use a Score with described levels instead of tuning a Noul for agreement.
- Score levels are judged independently — the model does not see their neighbors. "Worse than the previous level" is meaningless; each level must describe a concrete situation on its own.
Model Aliases and Version Pinning
GET https://api.typesafe.ai/v1/models lists available models. Today the current model is jev-1.13.0, with two aliases: jev-latest (the stable default) and jev-preview.
Every response reports the versioned ID that answered. Once a threshold matters, request the versioned ID explicitly and log it — tuning against an alias means your thresholds can silently drift when the alias moves.
Limits
| Bound | Value |
|---|---|
| Total request (state + all questions) | ~64k tokens |
| State + longest single question | ~32k tokens (~150k characters of English) |
| Options in one Choice | 255 |
| Score levels | 2–10 |
| Rate limit | 250,000 tokens/s and 1,200 requests/min |
| Modalities | Text only — no images, audio, or video |
Rate limits are adjusted dynamically during early access. The vendor SDKs retry with backoff, which matters because the endpoint returns 429 for rate limits and 529 for overload.
Error Codes
| Code | Meaning | What to do |
|---|---|---|
401 | Bad or missing API key | Check the key in your environment; never log it |
422 | Body validation failed | The response names the offending field — fix the request shape |
429 | Rate limited | Back off and retry; the SDKs do this by default |
529 | Provider overloaded | Retry with backoff |
Next Steps
- Prompt Engineering — the question craft that decides whether your integration works
- Confidence Gating — turn probabilities into automated, reviewed, and human paths
- Use Cases — where a decision model earns its place in your stack
Related Articles & Guides
Jev — TypeSafe's Decision Model Guide
Jev is a System One decision model: send typed state and questions, get probabilities instead of prose. Setup, prompt engineering, patterns, and integrations.
Jev Prompt Engineering — Questions, Criteria & State
How to write Jev questions and criteria that hold up: one judgment per question, situation-based criteria, clean state, parallelism, and the model's known failures.
Jev Integrations — SDKs, LangChain, Vercel & MCP
Wire Jev into your stack: official SDKs, raw HTTP, LangChain middleware, the Vercel AI SDK evaluation path, gateways, and MCP servers.