Quickstart: your first Jev call in 5 minutes
You need an API key from console.typesafe.ai. Then it is one POST. Below is a complete, copy-pasteable example that asks three different types of question in a single call.
1. The raw API call
curl -X POST https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" -d @- <<'EOF'
{
"state": "Our Stripe integration has been failing
for 3 days and we can't ship any orders!",
"model": "jev-latest",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this",
"criteria": {
"billing": "Payment issues",
"technical": "Bugs / integration",
"sales": "Pricing questions"
}
},
"is_urgent": {
"type": "noul",
"instructions": "Does this convey urgency?"
},
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}
EOF
2. The response
Typed answers, ready for code — no parsing, no regex, no "the LLM ignored the JSON schema" fire drill:
{
"answers": {
"department": {
"choice": "technical",
"probabilities": { "technical": 0.93, "billing": 0.05, "sales": 0.02 },
"confidence": 0.88
},
"is_urgent": { "noul": 0.999 },
"frustration":{ "score": 1.62, "confidence": 0.79 }
},
"usage": { "input_tokens": 312 }
}
3. The SDKs
- Python:
pip install typesafe-sdk(needs Python ≥ 3.10). ThenTypeSafeClient().system_one(state=..., questions={...})— it readsTYPESAFE_API_KEYfrom the environment automatically. - JavaScript:
@typesafe-ai/sdkon npm. - Agent skill: Claude Code users can install the official skill:
claude plugin install typesafe@typesafe-ai.
4. First-call checklist
Before you trust the output:
- Keep the state minimal and relevant — irrelevant context degrades accuracy (context rot).
- Make each question atomic: something an expert could answer in seconds.
- Write instructions literally — the model does not read between the lines.
- Read the confidence, not just the answer — it is your safety valve.
Once this works, the next step is wiring it into real logic — that is Patterns, with working code.