Evaluate decision questions
curl --request POST \
--url https://api.tokenlab.sh/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"state": "<string>",
"questions": {}
}
'import requests
url = "https://api.tokenlab.sh/v1/systemone"
payload = {
"model": "<string>",
"state": "<string>",
"questions": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', state: '<string>', questions: {}})
};
fetch('https://api.tokenlab.sh/v1/systemone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenlab.sh/v1/systemone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'state' => '<string>',
'questions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/systemone"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"state\": \"<string>\",\n \"questions\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenlab.sh/v1/systemone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"state\": \"<string>\",\n \"questions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/systemone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"state\": \"<string>\",\n \"questions\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": {},
"id": "<string>",
"usage": {
"input_tokens": 1,
"output_tokens": 1
}
}Text
Evaluate Decisions
Evaluate named probability, choice, and score questions with a native decision model.
POST
/
v1
/
systemone
Evaluate decision questions
curl --request POST \
--url https://api.tokenlab.sh/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"state": "<string>",
"questions": {}
}
'import requests
url = "https://api.tokenlab.sh/v1/systemone"
payload = {
"model": "<string>",
"state": "<string>",
"questions": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', state: '<string>', questions: {}})
};
fetch('https://api.tokenlab.sh/v1/systemone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenlab.sh/v1/systemone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'state' => '<string>',
'questions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/systemone"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"state\": \"<string>\",\n \"questions\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenlab.sh/v1/systemone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"state\": \"<string>\",\n \"questions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/systemone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"state\": \"<string>\",\n \"questions\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": {},
"id": "<string>",
"usage": {
"input_tokens": 1,
"output_tokens": 1
}
}Send
The response preserves your question names under
The HTTP request is also usable with standard
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 type | Criteria | Result |
|---|---|---|
noul | Optional object with both true and false guidance | noul, a probability from 0 to 1 |
choice | Object of 1–255 option names mapped to guidance or null | choice, optionally probabilities and confidence |
score | Ordered array of 2–10 descriptions | score from 0 to the last index; it can be fractional, with optional legend, probabilities, and confidence |
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"]
}
}
}'
fetch or requests clients. A decision response is structured data, not a generated text explanation.Authorizations
API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
Headers
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, upstream acceptance, or persistent resource creation.
Available options:
auto, verified, official Body
application/json