Decisions API
POST /api/v1/decisions — typed decisions. Send state and typed questions; get structured answers. Not chat. POST /api/v1/systemone is the same handler.
Evaluate application state against typed questions and get structured answers (probabilities, not generated chat text). This is TypeSafe's System One contract — not OpenAI Chat Completions.
/api/v1/decisionsPOST /api/v1/systemone is the same handler, auth, and body. Prefer /api/v1/decisions.
Authenticate with an LLM API key (sk-ar-v1-…) from /dashboard/keys, sent as Authorization: Bearer …. You also need a BYOK key for a provider that serves Jev, saved under Dashboard → BYOK: TypeSafe, LLM Gateway, Vercel AI Gateway, AIHubMix, or AutoJev.
Do not send decision requests to /chat/completions. Jev is a decision model (capability: systemone) and is rejected on chat-shaped endpoints.
Request
| Field | Type | Required | Description |
|---|---|---|---|
state | string | object | array | yes | Content to evaluate: plain text or structured application state. |
model | string | yes | Catalog id, e.g. typesafe/jev. Aliases: typesafe/jev-latest, typesafe/jev-preview, typesafe/jev-1.13.0. |
questions | object | yes | Non-empty map of question id → { type, instructions, criteria? }; do not send an array. Types: noul, choice, score. |
Question types
type | Meaning | Answer |
|---|---|---|
noul | Yes/no; optional criteria is an object with true and false descriptions | noul probability in [0, 1] |
choice | One option; criteria must be an object map of option → description or null | choice, probabilities, confidence |
score | Ordered criteria array with 2–10 level descriptions | score, legend, probabilities, confidence |
Response
{
"model": "jev-1.13.0",
"answers": {
"is_urgent": { "type": "noul", "noul": 0.92 }
},
"usage": { "input_tokens": 312, "output_tokens": 48, "cost": 0 }
}
Upstream TypeSafe bills input tokens only (output is free). This hop is BYOK: AnyRouter does not charge credits.
Example
curl -sS https://anyrouter.dev/api/v1/decisions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "Help! My payouts have been failing for 3 days.",
"model": "typesafe/jev",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this convey urgency?"
}
}
}'
See TypeSafe's API reference and models for primitives, confidence, and rate limits.