Tutorials
Jev cURL Examples
Call the TypeSafe Jev HTTP API with cURL: authentication, mixed questions, listing models, and error codes.
- Published
- Sep 20, 2026
- Updated
- Sep 20, 2026
- Last verified
- Sep 20, 2026
Quick answer
POST JSON to https://api.typesafe.ai/v1/systemone with Authorization: Bearer $TYPESAFE_API_KEY. Send model, state, and a questions object. Use GET /v1/models to list aliases. Retry 429 and 529 with backoff.
cURL is the fastest way to see the real JSON. Application code should still use an SDK so retries are not hand-rolled.
Auth and endpoint
export TYPESAFE_API_KEY=your_key_herePOST https://api.typesafe.ai/v1/systemone
Authorization: Bearer $TYPESAFE_API_KEY
Content-Type: application/jsonMinimal Noul
curl -s https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"state": "Please refund the duplicate charge on order A-104 today.",
"questions": {
"refund_requested": {
"type": "noul",
"instructions": "Does the customer ask for money back?"
}
}
}'Mixed questions
Official quickstart body, slightly compacted:
curl -X POST https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
"state": "Hi, I have been trying to connect my Stripe account for 3 days and the integration keeps failing. I am losing sales. Please help ASAP.",
"model": "jev-latest",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this",
"criteria": {
"billing": "Payment or subscription issues",
"technical": "Bugs or integration problems",
"sales": "Pricing or account questions"
}
},
"frustration": {
"type": "score",
"instructions": "How frustrated the customer appears",
"criteria": [
"Calm, just stating facts",
"Frustrated but civil",
"Very angry, strong language"
]
},
"is_urgent": {
"type": "noul",
"instructions": "The message conveys urgency or time-sensitivity"
}
}
}
EOFWindows PowerShell users: write the JSON to a file and pass --data-binary @request.json. Here-docs are bash.
Expected output
Shape from official docs — example output, not a live capture from this site:
{
"model": "jev-1.13.0",
"answers": {
"department": {
"type": "choice",
"choice": "technical",
"confidence": 0.78,
"probabilities": {
"technical": 0.85,
"sales": 0.0,
"billing": 0.15
}
}
},
"usage": { "input_tokens": 392, "output_tokens": 65 }
}List models
curl https://api.typesafe.ai/v1/models \
-H "Authorization: Bearer $TYPESAFE_API_KEY"Errors you will actually see
| Code | Typical cause |
|---|---|
| 401 | Key missing or wrong |
| 422 | Bad type, missing criteria on Choice/Score |
| 429 / 529 | Back off |
When to use cURL
Debugging payloads, sharing a failing request, CI smoke tests.
When not to
Production loops. Use Python or TypeScript.
Common mistakes
-dwithoutContent-Type: application/json.- Single-quoted JSON inside PowerShell.
- Forgetting that question IDs must be an object, not an array.
FAQ
What URL do I POST to?
https://api.typesafe.ai/v1/systemone
Can I pin a version from cURL?
Yes. Set "model": "jev-1.13.0" instead of jev-latest.
Sources
- Quick startTypeSafe · accessed 2026-09-20 · documentation
- API referenceTypeSafe · accessed 2026-09-20 · documentation
- ModelsTypeSafe · accessed 2026-09-20 · documentation