skip to content
superbot.gg

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.

Operation id createDecision in Gateway.

Request body

application/json, required.

  • model string required

    One of superbot, superbot-fast.

  • input string | array of DecisionInputItem required

    The evidence every question is asked about: a text, or an ordered array of messages, tool calls and tool outputs.

  • questions array of DecisionQuestion required

Body reference: OpenAI Decisions reference.

Response 200

One answer per question, in question order.

application/json: Decision.

  • model string required
  • answers array of DecisionAnswer required
  • usage object required

    Summed over the questions that were answered.

    5 fields
    • input_tokens integer required
    • input_tokens_details object required
      2 fields
      • cached_tokens integer required
      • cache_write_tokens integer required
    • output_tokens integer required
    • output_tokens_details object required
      1 field
      • reasoning_tokens integer required
    • total_tokens integer required

Errors

StatusCodeWhat to change
400invalid_request

A parameter or body field is invalid; param names it and issues lists every problem.

401unauthorized

Send a live caller key or session as Authorization: Bearer … or x-api-key. No key yet: create one at /account/api, or sign a user in at /auth.md.

402insufficient_balance

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).

402daily_limit

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).

402monthly_limit

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).

402member_monthly_limit

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).

402org_monthly_limit

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).

403insufficient_scope

The key lacks the scope in required_scopes; mint a key that holds it.

403model_not_allowed

The key lacks gateway:invoke (insufficient_scope), or the model is off its list or its team’s allow-list (model_not_allowed).

404model_not_found

The model does not make decisions (model_not_found).

413request_too_large

The body is over the size limit (request_too_large).

429rate_limited

Over the per-key request bucket; retry after x-ratelimit-reset.

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).

view .mdopenapi
Request

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())
Response

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"