Skip to content

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.

POST/api/v1/decisions

POST /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

FieldTypeRequiredDescription
statestring | object | arrayyesContent to evaluate: plain text or structured application state.
modelstringyesCatalog id, e.g. typesafe/jev. Aliases: typesafe/jev-latest, typesafe/jev-preview, typesafe/jev-1.13.0.
questionsobjectyesNon-empty map of question id → { type, instructions, criteria? }; do not send an array. Types: noul, choice, score.

Question types

typeMeaningAnswer
noulYes/no; optional criteria is an object with true and false descriptionsnoul probability in [0, 1]
choiceOne option; criteria must be an object map of option → description or nullchoice, probabilities, confidence
scoreOrdered criteria array with 2–10 level descriptionsscore, 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.