TokenLab

Text

Evaluate Decisions

Evaluate named probability, choice, and score questions with a native decision model.

POST
/v1/systemone

Send state and named questions to a decision model. Use GET /v1/models?category=decision for current availability and GET /v1/models/{model} for its published contract.

state and each question's instructions accept a string, JSON object, or JSON array. The endpoint returns synchronous JSON.

Question typeCriteriaResult
noulOptional object with both true and false guidancenoul, a probability from 0 to 1
choiceObject of 1–255 option names mapped to guidance or nullchoice, optionally probabilities and confidence
scoreOrdered array of 2–10 descriptionsscore from 0 to the last index; it can be fractional, with optional legend, probabilities, and confidence

The response preserves your question names under answers. usage.input_tokens and usage.output_tokens report observed usage when available. Pricing comes from the model's current tariff; free output does not imply zero output tokens.

Chat messages, tools, streaming, and Batch are not part of this endpoint's contract.

curl https://api.tokenlab.sh/v1/systemone \
  -H "Authorization: Bearer $TOKENLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-1.13",
    "state": "I was charged twice. Please refund the duplicate payment.",
    "questions": {
      "refund_requested": {"type": "noul", "instructions": "Is a refund requested?"},
      "department": {
        "type": "choice", "instructions": "Which team should handle this?",
        "criteria": {"billing": "Charges and refunds", "technical": "Software bugs"}
      },
      "urgency": {
        "type": "score", "instructions": "Rate urgency",
        "criteria": ["Routine enquiry", "Money affected", "Safety emergency"]
      }
    }
  }'

The HTTP request is also usable with standard fetch or requests clients. A decision response is structured data, not a generated text explanation.

curl -X POST "https://example.com/v1/systemone" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "state": "string",    "questions": {      "property1": {        "type": "noul",        "instructions": "string"      },      "property2": {        "type": "noul",        "instructions": "string"      }    }  }'
{  "id": "string",  "model": "string",  "answers": {    "property1": {      "type": "noul",      "noul": 0    },    "property2": {      "type": "noul",      "noul": 0    }  },  "usage": {    "input_tokens": 0,    "output_tokens": 0  }}

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Headers

X-TokenLab-Delivery-Policy?string

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Value in

  • "auto"
  • "verified"
  • "official"

Request Body

application/json

Response

application/json

application/json

application/json

application/json