Create a decision
OpenAI Decisions on superbot or superbot-fast: one shared input and 1 to 400 questions, answered in question order. Each question is asked on its own (8 at a time) with the input as a shared, cached prefix, and its answer is read off the model’s token probabilities, never sampled text. Tool calls and tool outputs in input are read as evidence. Billed to your credits at the model’s rate, per question, for the tokens usage names, and counted on the key’s usage (GET /v1/usage) and its spend limits. A caller key’s own limits apply before any question is asked, as on every model call: its per-minute rate limit, its daily and monthly spend limits, its model list and its team’s model allow-list and spend limits. A question whose own call fails while others are answered comes back as a refusal, and the rest are answered; the request fails as a whole when no question is answered, or when a failure every question shares (credits, plan) comes first. Every refusal is OpenAI’s error object {error: {message, type, param, code}}: 400 invalid_request with param; 404 model_not_found; 502 decision_unavailable when the model answered without token probabilities.
Part of Gateway, 9 operations. The overview covers keys, scopes and errors.
POST /v1/decisions
A caller key holding gateway:invoke (Authorization: Bearer sbc_… or x-api-key: sbc_…), or a signed-in session.
Request body
modelstring requiredOne of
superbot,superbot-fast.inputstring | array of DecisionInputItem requiredThe evidence every question is asked about: a text, or an ordered array of messages, tool calls and tool outputs.
questionsarray of DecisionQuestion required
Body reference: OpenAI Decisions reference.
Response 200
One answer per question, in question order.
modelstring requiredanswersarray of DecisionAnswer requiredusageobject requiredSummed over the questions that were answered.
5 fields
input_tokensinteger requiredinput_tokens_detailsobject required2 fields
cached_tokensinteger requiredcache_write_tokensinteger required
output_tokensinteger requiredoutput_tokens_detailsobject required1 field
reasoning_tokensinteger required
total_tokensinteger required
Errors
| Status | Code | What to change |
|---|---|---|
| 400 | invalid_request | A parameter or body field is invalid; |
| 401 | unauthorized | Send a live caller key or session as |
| 402 | insufficient_balance | Your credits are spent ( |
| 402 | daily_limit | Your credits are spent ( |
| 402 | monthly_limit | Your credits are spent ( |
| 402 | member_monthly_limit | Your credits are spent ( |
| 402 | org_monthly_limit | Your credits are spent ( |
| 403 | insufficient_scope | The key lacks the scope in |
| 403 | model_not_allowed | The key lacks |
| 404 | model_not_found | The model does not make decisions ( |
| 413 | request_too_large | The body is over the size limit ( |
| 429 | rate_limited | Over the per-key request bucket; retry after |
| 5XX | The model is unavailable (503 |
curl
curl -sS -X POST "https://superbot.gg/v1/decisions" \
-H "Authorization: Bearer $SUPERBOT_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"superbot","input":"your-input","questions":[]}'JavaScript
const res = await fetch(`https://superbot.gg/v1/decisions`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
'content-type': 'application/json',
},
body: JSON.stringify({"model":"superbot","input":"your-input","questions":[]}),
});
console.log(res.status, await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://superbot.gg/v1/decisions",
headers={
"Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
"content-type": "application/json",
},
json={"model":"superbot","input":"your-input","questions":[]},
)
print(res.status_code, res.json())200 One answer per question, in question order.
{
"model": "superbot",
"answers": [
"your-answers"
],
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}400 The body is not a decision request (`invalid_request`, with `param`).
"string"401 No valid bearer (`unauthorized`).
"string"402 Your credits are spent (`insufficient_balance`), or the key or its team reached a spend limit (`daily_limit`, `monthly_limit`, `member_monthly_limit`, `org_monthly_limit`).
"string"403 The key lacks `gateway:invoke` (`insufficient_scope`), or the model is off its list or its team’s allow-list (`model_not_allowed`).
"string"404 The model does not make decisions (`model_not_found`).
"string"413 The body is over the size limit (`request_too_large`).
"string"429 The key’s per-minute rate limit, or the model’s (`rate_limited`), with `Retry-After`.
"string"5XX The model is unavailable (503 `router_unavailable`, `shed` with `Retry-After`), answered without token probabilities (502 `decision_unavailable`), or did not answer in time (504).
"string"No operation matches this filter.