Avaliar perguntas de decisão
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
}
}
Texto
Avaliar Decisões
Avalie perguntas nomeadas de probabilidade, escolha e pontuação com um modelo de decisão nativo.
POST
/
v1
/
systemone
Avaliar perguntas de decisão
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
}
}
Envie
A resposta preserva os nomes das suas perguntas em
A requisição HTTP também pode ser utilizada com clientes
state e questions nomeadas para um modelo de decisão. Use GET /v1/models?category=decision para verificar a disponibilidade atual e GET /v1/models/{model} para o seu contrato publicado.
O state e as instructions de cada pergunta aceitam uma string, um objeto JSON ou um array JSON. O endpoint retorna JSON de forma síncrona.
| Tipo de pergunta | Critérios | Resultado |
|---|---|---|
noul | Objeto opcional com orientações para true e false | noul, uma probabilidade de 0 a 1 |
choice | Objeto de 1 a 255 nomes de opções mapeados para orientações ou null | choice, opcionalmente probabilities e confidence |
score | Array ordenado de 2 a 10 descrições | score de 0 até o último índice; pode ser fracionário, com legend, probabilities e confidence opcionais |
answers. usage.input_tokens e usage.output_tokens relatam o uso observado quando disponível. A precificação é baseada na tarifa atual do modelo; saída gratuita não implica em zero tokens de saída.
Mensagens de chat, ferramentas, streaming e Batch não fazem parte do contrato deste endpoint.
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 ou requests padrão. Uma resposta de decisão é um dado estruturado, não uma explicação em texto gerada.Autorizações
Autenticação por Chave de API. Crie ou gerencie chaves de API em Dashboard > API > API Keys.
Cabeçalhos
Política de entrega por requisição. Substitui os padrões da API key e do Workspace. Tenta automaticamente o TokenLab Verified primeiro e pode alternar uma vez para Official apenas antes da saída, aceitação upstream ou criação de recurso persistente.
Opções disponíveis:
auto, verified, official Corpo
application/json