Get a key, then make one narrow call
Create an API key in the TypeSafe console and export TYPESAFE_API_KEY. Install typesafe-sdk on Python 3.10+ or @typesafe-ai/sdk on Node 20+. The first useful call is a question your app already answers badly with rules or a chat completion.
Keep the answer set small and stable. Name the field after the branch your code will take, not after a vague theme.
from typesafe_sdk import Choice, TypeSafeClient
with TypeSafeClient() as client:
response = client.system_one(
state={"document": "I was charged twice. Please fix this ASAP."},
questions={
"category": Choice(
instructions="What is this ticket about?",
criteria={"billing": None, "technical": None, "other": None},
),
},
)
print(response.choices["category"].choice) The HTTP contract
If you skip the SDK, the request is still one POST. model selects jev-latest or a pinned version. state can be a string, object, or list of text. questions is a map of named question objects. TypeSafe documents a combined context budget around 64k tokens, with about 32k for state plus the longest question.
- Rate limits published at launch: 250,000 tokens/second and 1,200 requests/minute. Confirm in current docs.
- Batch related questions in one call so they share state cost and return together.
- Put a confidence threshold in your code. Jev makes the branch easier, not risk-free.
curl -X POST https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"state": "Customer: I was charged twice and I am furious.",
"questions": {
"topic": {
"type": "choice",
"instructions": "What is the issue about?",
"criteria": { "billing": "money problems", "bug": "broken product" }
},
"urgent": {
"type": "noul",
"instructions": "Escalate to a human now?"
}
}
}' What to do with the answer
Branch in application code. If topic is billing and escalate.noul is above your threshold, route to a human. If confidence is low, send the same state to a larger model or a reviewer. Log input, output, version, and the downstream result so you can tell whether Jev is helping the workflow or only looking decisive.
FAQ
How do I use the Jev API?
POST JSON to https://api.typesafe.ai/v1/systemone with a Bearer TypeSafe key. Send model, state, and a map of typed questions. Official SDKs read TYPESAFE_API_KEY.
Which Jev model ID should I pin?
Use jev-1.13.0 in production if your thresholds are tuned. jev-latest and jev-preview currently resolve to the same version, but aliases can move.
Does Jev work through Vercel AI Gateway?
Yes. The Gateway model ID is typesafe-ai/jev. That path is useful if you already have Vercel billing and do not want to wait on a TypeSafe key.