Vai al contenuto

Documentazione

Inizia con un solo prompt.

ScaledThought è pensato prima di tutto per gli agenti: il tuo agente si registra e fa il lavoro, e tu hai una dashboard per fatturazione, chiavi e colleghi quando ti serve. Tutto ciò che trovi qui è scritto per te e per l'agente. L'API è OpenAI-compatible: la maggior parte del codice che usa l'SDK di OpenAI funziona cambiando il base URL e la chiave.

Guida rapida

1

Il modo più semplice: chiedi al tuo agente

Incolla questo in Claude Code, Codex, Cursor o qualsiasi agente in grado di eseguire comandi. Legge /llms.txt ed esegue i passaggi di configurazione.

Apri questo prompt inClaude CodeClaude DesktopCodex

Link diretti alle app che hai installato. Claude e Claude Code sono marchi di Anthropic; Codex è un marchio di OpenAI. ScaledThought non è affiliata a nessuna delle due né approvata da esse.

Non affiliati né approvati da Anthropic, OpenAI, Cursor o da alcun editore di modelli. Claude, Claude Code, Codex, Cursor, OpenAI e i nomi dei modelli sono marchi dei rispettivi proprietari.

2

Oppure esegui un comando

Crea un account nella regione Stati Uniti, scrive ST_API_KEY e ST_BASE_URL in .env ed elenca i modelli online lì. Puoi rieseguirlo senza rischi: se c'è già una chiave, si limita a mostrare l'account. La regione Canada è in arrivo; finché non apre, la sua API non risponde e --region ca fallisce con network_error.

shell
npx -y scaledthought@0.3 init --region us
3

Acquista crediti

Ogni chiamata si paga con crediti prepagati, Da $20 a $2,000 per ricarica, al massimo $2,000 ogni 24 ore e 2 link di approvazione aperti alla volta. L'agente chiede una ricarica e invia l'approval_url che riceve alla persona per cui lavora, che paga con carta. Finché i crediti non arrivano, le chiamate restituiscono 402 insufficient_credits. Altri dettagli in Crediti e approvazione.

shell
npx -y scaledthought@0.3 billing topup --amount-usd 20
4

Fai la tua prima chiamata

curl "$ST_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $ST_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "deepseek-v4-1-flash",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Autenticazione

Invia la tua chiave come bearer token. Le chiavi sono limitate a una regione e possono avere un proprio budget. Il base URL è l'host della tua regione, salvato in .env come ST_BASE_URL: https://api.us.scaledthought.com/v1 (quello del Canada, https://api.ca.scaledthought.com/v1, è in arrivo).

headers
Authorization: Bearer $ST_API_KEY
Content-Type: application/json

Chat completions

POST /v1/chat/completions accetta il formato di richiesta di OpenAI. Usa un id di modello da npx -y scaledthought@0.3 models --live o da /pricing.

curl "$ST_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $ST_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "deepseek-v4-1-flash",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Streaming

Imposta stream: true per ricevere server-sent events nel formato delta di OpenAI.

stream = client.chat.completions.create(
    model="deepseek-v4-1-flash",
    messages=[{"role": "user", "content": "Write a haiku about open weights"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Chiamata di strumenti

Passa tools nel formato di OpenAI. I modelli che supportano la chiamata di strumenti restituiscono tool_calls standard. Supporto e qualità variano da modello a modello, quindi controlla la scheda di un modello prima di farci affidamento.

Python
resp = client.chat.completions.create(
    model="deepseek-v4-1-flash",
    messages=[{"role": "user", "content": "Weather in Toronto?"}],
    tools=[{
        "type": "function",
        "function": {
            "name": "get_weather",
            "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]},
        },
    }],
)
print(resp.choices[0].message.tool_calls)

Output strutturato

Usa response_format con uno schema JSON. Sui modelli che lo supportano, l'output è vincolato allo schema durante la decodifica. Convalida il risultato prima di farci affidamento.

Python
resp = client.chat.completions.create(
    model="deepseek-v4-1-flash",
    messages=[{"role": "user", "content": invoice_text}],
    response_format={
        "type": "json_schema",
        "json_schema": {"name": "invoice", "schema": {
            "type": "object",
            "properties": {"vendor": {"type": "string"}, "total": {"type": "number"}},
            "required": ["vendor", "total"],
        }},
    },
)

Responses API e Codex

POST $ST_BASE_URL/responses parla la Responses API di OpenAI, quindi i client che usano solo quel protocollo, come Codex, possono usare ScaledThought come provider di modelli. Accetta input (una stringa, oppure messaggi ed elementi function_call e function_call_output), instructions, strumenti function e custom (in formato libero), tool_choice, max_output_tokens, text.format per l'output JSON e stream: true (eventi Responses, che terminano con response.completed o response.incomplete con il relativo usage, oppure response.failed con un error).

È stateless. Non conserviamo nessuna risposta, quindi invia l'intera conversazione in input a ogni turno (Codex lo fa) e ometti previous_response_id, che restituisce 400 invalid_request; store è sempre false. Gli strumenti ospitati come la ricerca nei file restituiscono 400; uno strumento di ricerca web viene ignorato. Le richieste senza max_output_tokens ricevono come limite lo spazio che il contesto del modello lascia dopo il tuo prompt, al massimo 32.768 token.

La fatturazione è la stessa delle chat completions: per token, in base all'uso riportato dal server del modello, pagata con i tuoi crediti.

# ~/.codex/config.toml
model = "deepseek-v4-1-flash"  # or a model id from `npx -y scaledthought@0.3 models --live`
model_provider = "scaledthought"

[model_providers.scaledthought]
name = "ScaledThought"
base_url = "https://api.us.scaledthought.com/v1"  # your ST_BASE_URL
env_key = "ST_API_KEY"
wire_api = "responses"
model_catalog_url = "https://api.us.scaledthought.com/v1/codex/models"  # same host (and region) as base_url

Codex legge ST_API_KEY dall'ambiente, quindi carica prima ./.env nella shell. wire_api = "responses" è obbligatorio: ScaledThought serve Codex tramite la Responses API.

model_catalog_url comunica a Codex le finestre di contesto dei modelli online nella tua regione, così compatta per tempo le sessioni lunghe, e gli fornisce il suo strumento di modifica apply_patch. Viene generato dai modelli online a ogni richiesta; Codex vi invia la tua chiave, quindi tienilo sullo stesso host di base_url (quello della tua regione).

Modelli e benchmark

GET /v1/models elenca gli id dei modelli online nella tua regione, nel formato di OpenAI. Quell'elenco è il riferimento per sapere cosa puoi chiamare. GET /v1/models/{id} restituisce per un modello prezzi, lunghezza del contesto, data di rilascio, punteggi nei benchmark e stato online, così un agente può scegliere senza che una persona legga una pagina web. Per cercare e filtrare, usa npx -y scaledthought@0.3 models --live o lo strumento MCP models_search. Per le persone, /pricing elenca ogni modello online negli Stati Uniti con il suo prezzo, dalla stessa API.

curl "$ST_BASE_URL/models"
curl "$ST_BASE_URL/models/deepseek-v4-1-flash"

Regioni e conservazione

Ogni chiave è vincolata alla propria regione. La regione Stati Uniti è aperta ora; il Canada (ca) è in arrivo e la sua API non risponde finché non apre. Le richieste vengono servite e registrate nei log, e i dati di account e di utilizzo conservati, solo in quel paese. I pagamenti con carta per ogni regione sono elaborati da Stripe negli Stati Uniti. Prompt e completion non vengono conservati dopo che la risposta è stata restituita e non vengono mai usati per l'addestramento. I file di batch e di fine-tuning vengono cancellati dopo 30 giorni, o prima con DELETE /v1/files/{id}. Ogni risposta include x-st-region e x-st-data-retention: none. Vedi sicurezza (o /security.json) e l'Informativa sulla privacy (in inglese).

Chiavi e budget

Gli agenti possono creare chiavi con ambiti limitati e limiti di spesa giornalieri rigidi. Quando un budget viene raggiunto, le chiamate restituiscono 402 invece di spendere ancora. Una chiave revocata smette di funzionare entro circa 30 secondi.

npx -y scaledthought@0.3 keys create --name support-bot --budget-usd 40

Ambiti (scopes): inference, read, keys, billing. Una chiave può dare a una nuova chiave solo gli ambiti che ha lei stessa (altrimenti 403 scope_not_allowed). Scadenza: invia expires_in (ad esempio "30d") o expires_at, fino a 365 giorni; dopo, la chiave riceve 401 key_expired. Una chiave non sopravvive mai alla chiave che l'ha creata.

Chiavi per sotto-agenti: con child: true la nuova chiave registra la chiave chiamante come chiave madre. Il suo budget giornaliero rientra in ciò che resta oggi alla chiave madre, i suoi limiti di frequenza e la sua scadenza non superano quelli della madre, e può gestire solo le proprie sotto-chiavi. Revocare una chiave revoca tutte le chiavi sotto di essa.

Rotazione: POST /v1/keys/{id}/rotate crea una chiave sostitutiva con lo stesso nome, ambiti, budget e limiti, restituita una sola volta. La vecchia chiave continua a funzionare per grace (predefinito 24h, da "0" a "7d"). Auto-revoca: DELETE /v1/keys/self revoca la chiave chiamante e le sue chiavi per sotto-agenti, senza bisogno di alcun ambito, così un agente che sospetta una fuga di dati può agire subito.

npx -y scaledthought@0.3 keys create --name sub-agent --child --scopes inference --budget-usd 2 --expires-in 12h
npx -y scaledthought@0.3 keys rotate key_… --grace 24h
npx -y scaledthought@0.3 keys revoke-self

Altri dettagli su come proteggiamo chiavi e dati: sicurezza.

Crediti e approvazione

L'uso si paga con crediti prepagati, Da $20 a $2,000 per ricarica, al massimo $2,000 ogni 24 ore e 2 link di approvazione aperti alla volta. L'agente chiede una ricarica (20 $ per impostazione predefinita) e riceve un approval_url: una pagina di finanziamento in cui la persona per cui lavora conferma o modifica l'importo, può attivare la ricarica automatica e paga con carta. I crediti arrivano una volta confermato il pagamento, e inviamo una ricevuta via email. Non viene mai addebitato nulla senza quell'approvazione. I crediti non scadono. Quando finiscono, le richieste restituiscono 402 insufficient_credits con il saldo e l'importo necessario.

npx -y scaledthought@0.3 billing topup --amount-usd 20

La ricarica automatica è facoltativa e consigliata: quando il saldo scende sotto una soglia (predefinita 5 $), la carta salvata aggiunge un importo fisso (predefinito 20 $), così l'agente non si blocca mai. La persona la attiva dalla pagina di finanziamento di qualsiasi ricarica, oppure senza acquistare nulla tramite un link di configurazione della ricarica automatica (billing auto-reload setup), dove salva una carta. Le ricariche sono limitate a 2.000 $ ogni 24 ore. Attivarla o alzare un qualsiasi limite richiede una nuova approvazione; disattivarla o abbassarla no. Se una ricarica viene rifiutata, la ricarica automatica si disattiva da sola e il 402 successivo dice all'agente di ottenere un nuovo link. billing status mostra il saldo e le eventuali ricariche in sospeso; billing transactions elenca ogni acquisto, ricarica e addebito.

npx -y scaledthought@0.3 billing topup --amount-usd 20 --auto-reload-below 5 --auto-reload-amount 20
npx -y scaledthought@0.3 billing auto-reload setup --below 5 --amount 20   # no purchase: they save a card
npx -y scaledthought@0.3 billing auto-reload off

Avvisi e webhook

Le risposte possono includere x-st-notice con codici separati da virgole: low_balance (un account con saldo inferiore a $5). Un agente che ne vede uno dovrebbe dire alla persona per cui lavora cosa approvare. GET /v1/account, account_status di MCP, status e doctor mostrano gli stessi codici con le parole da riferire.

I webhook inviano invece gli stessi segnali: balance.low, key.expiring e budget.exhausted. Gli endpoint devono essere URL https pubblici sulla porta 443. Ogni POST include x-st-signature: t=…,v1=…, un HMAC-SHA256 di <t>.<raw body> con chiave il segreto di firma dell'endpoint, mostrato una sola volta quando lo aggiungi. Le consegne vanno al tuo URL ovunque sia ospitato, anche fuori dalla regione del tuo account, e contengono solo id, type, created_at, region, account_id e data: id, importi interi in micro-dollari, conteggi di giorni e timestamp, mai prompt, nomi o email. data per evento: balance.low {balance_micros, threshold_micros}, key.expiring {key_id, expires_at}, budget.exhausted {scope, key_id, budget_micros, spent_today_micros, resets_at}. Le consegne non riuscite vengono ritentate con backoff per circa due giorni.

npx -y scaledthought@0.3 webhooks add https://hooks.example.com/st --events balance.low,budget.exhausted

Header di richiesta facoltativi: x-st-app indica il nome della tua app nei record di utilizzo (non pubblicato), e x-st-session mantiene una conversazione sulla stessa replica così il suo prefisso in cache viene riutilizzato (solo in memoria, mai conservato). In Canada le richieste non vengono mai dirottate verso un altro paese: quando tutte le repliche di un modello sono occupate, una richiesta attende brevemente, poi riceve 429 capacity_exhausted con Retry-After.

Inferenza batch

Carica un file JSONL di richieste e ottieni i risultati al 50% del prezzo normale. I batch hanno una finestra di completamento di 24 ore e di solito terminano entro quel tempo, ma il completamento nei tempi non è garantito. Gli endpoint Files e Batches seguono quelli di OpenAI, quindi client.batches.create funziona. Ogni riga viene convalidata in anticipo, quindi un file non valido fallisce in pochi secondi.

batch_file = client.files.create(file=open("requests.jsonl", "rb"), purpose="batch")
batch = client.batches.create(
    input_file_id=batch_file.id,
    endpoint="/v1/chat/completions",
    completion_window="24h",
)
# later
batch = client.batches.retrieve(batch.id)
results = client.files.content(batch.output_file_id).text

Embedding

POST /v1/embeddings con un modello di embedding (trovane uno con models --live --modality embedding). L'input può essere una stringa o un array di stringhe.

Python
vecs = client.embeddings.create(model="<embedding-model-id>", input=["open weights", "served hot"])

Fine-tuning

Addestra un adapter LoRA sui tuoi esempi. Il risultato è un id di modello privato che solo il tuo account può chiamare, servito sulle stesse repliche del suo modello base e fatturato al prezzo per token del modello base. Si possono addestrare solo i modelli base che girano sulle nostre GPU nella tua regione, e gli adapter non si possono scaricare. L'addestramento si paga per 1M di token di addestramento (token del dataset × epoche); la risposta del job include una stima prima che parta qualsiasi cosa. Si paga con crediti prepagati. Vedi prezzi.

f = client.files.create(file=open("examples.jsonl", "rb"), purpose="fine-tune")
job = client.fine_tuning.jobs.create(model="<base-id>", training_file=f.id, suffix="triage")
# poll
job = client.fine_tuning.jobs.retrieve(job.id)
resp = client.chat.completions.create(model=job.fine_tuned_model, messages=[...])

Server MCP

MCP remoto sull'host API della tua regione: https://api.us.scaledthought.com/mcp (quello del Canada, https://api.ca.scaledthought.com/mcp, è in arrivo; Streamable HTTP, specifica 2026-07-28). Autenticati con la tua chiave API come bearer token. MCP non può creare account: registrati prima con npx -y scaledthought@0.3 init o POST /v1/accounts, poi npx -y scaledthought@0.3 mcp stampa il comando e la configurazione esatti per la tua regione. L'agente ottiene questi strumenti:

npx -y scaledthought@0.3 mcp
account_status
Region, spend, credit balance, auto-reload, key count and notices (tell your human about each). Call it first.
account_settings
Read or change account settings. ad_measurement: false opts the account out of ad measurement; any key can do it.
keys_manage
List, create, rotate or revoke keys (action: list | create | rotate | revoke | revoke_self). create and rotate return the full key once; create takes scopes, expires_in, child (a sub-agent key) and lives_in (where it will be stored); rotate takes grace. revoke_self revokes the key in use.
budget_manage
Set or clear a key's hard daily budget (USD) and rate limits.
webhooks
Signed HTTPS callbacks for balance.low, key.expiring and budget.exhausted (action: add | list | remove). add returns signing_secret once.
models_search
Models with prices, context, benchmarks and live status in your region (live_only, category, search).
benchmarks_get
Our own per-task scores and speed for one model.
usage_query
Requests, tokens and cost over the last N days, by model, day or key.
billing_topup
With amount_usd (and optional auto_reload): an approval_url for your human to buy credits. action: status | transactions | auto_reload_off.
fine_tuning
List, get, cancel fine-tuning jobs and their events; list your fine-tuned models.
docs_search
Where the docs, llms.txt and your base URL are.

CLI

Eseguila come npx -y scaledthought@0.3 <command>. L'output è JSON quando stdout non è un terminale (o con --json), e gli errori sono una riga JSON su stderr con code, message e hint. Non chiede mai input. Le chiavi arrivano da ST_API_KEY o da ./.env, mai da flag.

init --region us
Account and key in the US. Writes ST_API_KEY and ST_BASE_URL to .env. Safe to re-run. Canada (ca) is coming soon.
init --account Acme
In a new folder on a machine with saved accounts: use that account with a new project key (init asks which when there are several). --new-account makes a separate account; --no-save keeps the key out of this machine's credential store.
login --region us
Connect to an existing account: prints a code your human types on the dashboard's connect page (opened in their browser). Then run login --wait.
login --wait
Waits about 90 s for your human to approve the code, then writes a new key to .env (never printed). Re-run on authorization_pending.
login --code -
Use a connect line made on the dashboard (its stl_ code on stdin, out of shell history): already approved, works once for 15 minutes.
use "Side project"
Point this folder at another account saved on this machine: a new project key in .env; the folder's old project key is revoked.
init --region us --source a-rd
The same, recording the campaign code of the scaledthought.com/go/<code> link that brought you (optional). An invalid code is dropped with a warning.
models --live
Models serving in your region now, newest first, with prices. Filter with --category or --search. The US list is also on /pricing.
models <id>
Pricing, context, benchmarks and live status for one model.
chat -m <id> "prompt"
Send one message to a model id from models --live.
account
Region, spend and credit balance.
account ad-measurement off
Opt out of ad measurement: nothing about the account is ever sent to an ad platform. on turns it back on.
keys create --name <name> --budget-usd 5
New key with a hard daily budget in USD. The key is printed once.
keys create --name <name> --expires-in 30d --scopes inference,read
A key that expires (at most 365d) with a subset of your key's scopes.
keys create --name <name> --child --budget-usd 2
A sub-agent key: scopes, budget, rate limits and expiry within your key's; revoked when your key is.
keys list
Your keys (prefixes only).
keys rotate <id> --grace 24h
Replace a key: the new key is printed once; the old one keeps working for the grace period (0 to 7d).
keys revoke <id>
Revoke a key and its sub-agent keys. They stop working within about 30 seconds.
keys revoke-self
Revoke the key you are using now (and its sub-agent keys), e.g. if it may have leaked. Irreversible.
keys put github --repo <owner/repo> --budget-usd 2
Put a new sub-agent key straight into a platform's secret store as ST_API_KEY, through its own CLI with the key on stdin (never printed). Destinations: github, vercel, fly, cloudflare, gcp, aws, k8s, doppler. The key is named after the place and records where it lives (lives_in). If storing fails, the new key is revoked.
keys rotate --all --push --grace 1h
Rotate every key that keys put stored somewhere and put each replacement in the same place; the old keys stop after the grace period. Prints no keys. One key: keys rotate <id> --push.
connect opencode
Point an OpenAI-compatible tool at ScaledThought: opencode and aider get the base URL and their own sub-agent key in their config (files 0600, key never printed); cursor and continue get steps for your human.
usage --days 7 --by model
Requests, tokens and cost by model, day or key.
billing status
Credit balance, auto-reload, pending top-ups.
billing topup --amount-usd 20
Buy prepaid credits ($20 to $2,000 per top-up, at most $2,000 per 24 hours and 2 open approval links at a time; default 20): opens the funding page in your human's browser, where they confirm the amount, can turn on auto-reload and pay.
billing wait
Returns as soon as your human pays the open top-up, with the new balance. Polls about 90 seconds a run; run it again on topup_pending.
billing topup --amount-usd 20 --auto-reload-below 5 --auto-reload-amount 20
Top up with auto-reload pre-selected on the funding page (your human can untick it).
billing auto-reload setup --below 5 --amount 20
Turn auto-reload on without buying anything: opens a page where your human saves a card. Then billing wait.
billing auto-reload off
Turn auto-reload off. No approval needed.
billing transactions
The credit ledger: purchases, auto-reloads, usage, batches, fine-tuning, refunds.
batches create requests.jsonl
Upload a JSONL file and start a batch at 50% off. Needs prepaid credits.
fine-tune create examples.jsonl --model <base-id>
Upload a dataset and start a LoRA job. Needs prepaid credits.
webhooks add https://hooks.example.com/st --events balance.low,budget.exhausted
Get a signed POST when the balance is low, a key is about to expire or a budget is spent (default: every event). Prints signing_secret once.
webhooks list
Your webhook endpoints.
webhooks remove <id>
Delete a webhook endpoint.
doctor
Checks the key in .env, its region, the account and its credit, and lists notices to tell your human.
mcp
Prints the `claude mcp add` command and JSON config for your region.
dashboard --page billing
Opens your human's dashboard (overview, billing, keys, members, connect) in their browser. If they aren't signed in, one click emails them a link.
members
Who can sign in to the account's dashboard: email, role (owner or member), status.
status
Per-model health in your region over the last hour, plus your account's notices when a key is set.

Riferimento API

POST /v1/accounts
Create an account in this host's region. Returns api_key (once) and base_url. No auth. Optional source: the campaign code from a /go/<code> link.
POST /v1/chat/completions
Chat, tools, JSON output, streaming. OpenAI-compatible.
POST /v1/responses
The OpenAI Responses API (Codex): function and custom tools, streaming. Stateless: send the whole conversation each turn; previous_response_id isn't supported.
POST /v1/completions
Raw text completion.
POST /v1/embeddings
Embeddings for embedding models.
GET /v1/models
Model ids live in this region (OpenAI list format). No auth.
GET /v1/models/{id}
One model: pricing, context, benchmarks and live_in_region. No auth.
GET /v1/models/{id}/benchmarks
Our own per-task scores and speed.
GET /v1/account
Plan, region, balance, spend, key count and notices (low_balance) with notice_text to relay to your human.
PATCH /v1/account
Account settings: {"ad_measurement": false} opts out of ad measurement (any key); true needs the keys or billing scope.
GET /v1/keys
List keys.
POST /v1/keys
Create a key: scopes (a subset of yours), daily_budget_usd, rate limits, expires_in or expires_at (max 365d), child: true for a sub-agent key, lives_in (where it will be stored, display only).
POST /v1/keys/{id}/rotate
Replace a key. The new key is returned once; the old one works for grace (default 24h, 0 to 7d).
PATCH /v1/keys/{id}
Change a key's name, daily budget, rate limits or lives_in (null clears it).
DELETE /v1/keys/{id}
Revoke a key and its sub-agent keys.
DELETE /v1/keys/self
The calling key revokes itself and its sub-agent keys. No scope needed.
GET /v1/usage
Requests, tokens and cost (days, group_by).
GET /v1/billing
Credit balance, auto-reload, pending top-ups and recent transactions.
POST /v1/billing/topup
Buy credits: {amount_usd, auto_reload?} returns an approval_url for your human.
GET /v1/billing/topups/{id}
One top-up's status (open, paid, expired, failed).
PATCH /v1/billing/auto-reload
Disable or lower auto-reload. Raising it needs a new top-up approval.
GET /v1/billing/transactions
The credit ledger, newest first (cursor).
POST /v1/webhooks
Add a webhook: {url (public https, port 443), events}. Returns signing_secret once. Billing scope; at most 5.
GET /v1/webhooks
Your webhook endpoints (status, last success and failure).
DELETE /v1/webhooks/{id}
Delete a webhook endpoint.
POST /v1/files
Upload JSONL (purpose=batch or fine-tune).
POST /v1/batches
Start a batch. GET /v1/batches/{id} to poll, POST /v1/batches/{id}/cancel to stop.
POST /v1/fine_tuning/jobs
Start a LoRA job from an uploaded purpose=fine-tune file.
GET /v1/status
Per-model health in this region, last hour.
POST /v1/dashboard/link
A URL for your human's dashboard (optional page), the owners, and a message to relay. billing or keys scope.
POST /v1/device/codes
Ask to connect to an existing account. No key. Returns device_code (secret), user_code for your human to type at verification_url, expires_in, interval.
POST /v1/device/token
Collect the key once approved: {device_code}, or {connect_code} (stl_…) for a dashboard connect line. 428 authorization_pending until then; one key per code, with the approver's scopes.
GET /v1/members
Who can sign in to the dashboard (email, role, status). read scope.

Limiti di frequenza

I limiti sono per chiave. Oltre il limite, le chiamate restituiscono 429 rate_limit_exceeded con un header Retry-After in secondi. Fino al primo acquisto di crediti dell'account, le chiavi possono abbassare i propri limiti ma non alzarli.

Nuovo account
Richieste / min: 60
Token / min: 200,000
Spesa: Fino al primo acquisto di crediti: fino a 5 chiavi
Crediti prepagati
Richieste / min: 3,000
Token / min: 5,000,000
Spesa: Crediti acquistati dalla persona per cui lavora l'agente, da $20 a $2,000 per ricarica, $2,000 ogni 24 h
Scala
Richieste / min: Personalizzato
Token / min: Personalizzato
Spesa: Parla con noi

Errori

Gli errori API hanno la forma {"error":{"message","type","code"}}. Gli errori della CLI aggiungono un hint ed escono con un codice diverso da zero.

400
Codice: invalid_request
Cosa fare: Fix the field named in message. Don't retry unchanged.
400
Codice: invalid_body
Cosa fare: Fix the field named in message. Don't retry unchanged.
400
Codice: invalid_json
Cosa fare: Send valid JSON with `content-type: application/json`.
401
Codice: invalid_api_key
Cosa fare: Key missing, mistyped or revoked. Load ST_API_KEY from .env; don't create a new account.
401
Codice: missing_api_key
Cosa fare: Send `Authorization: Bearer $ST_API_KEY`.
401
Codice: key_expired
Cosa fare: The key's expires_at has passed. Use another key, or create a new one with a key that has the keys scope.
400
Codice: invalid_expiry
Cosa fare: expires_in or expires_at must be in the future and at most 365 days ahead. Send one, not both.
400
Codice: expiry_exceeds_parent
Cosa fare: A key can't outlive the key that creates it. Ask for at most max_expires_at from the body.
403
Codice: scope_not_allowed
Cosa fare: Ask only for scopes your own key has (allowed_scopes in the body).
400
Codice: budget_exceeds_parent
Cosa fare: A sub-agent key's daily budget must fit in what its parent has left today (max_daily_budget_usd in the body).
400
Codice: limit_exceeds_parent
Cosa fare: A sub-agent key's rate limits and budget can't exceed its parent's (or, when it changes itself, its own).
400
Codice: key_depth_exceeded
Cosa fare: Sub-agent keys nest at most 16 levels. Create the key from a key higher up.
404
Codice: key_not_found
Cosa fare: No such key on this account, or (for a sub-agent key) it's outside the keys you created.
409
Codice: key_not_active
Cosa fare: Only an active key can be rotated. Create a new key instead.
402
Codice: budget_exceeded
Cosa fare: This key's daily budget is spent. Resets 00:00 UTC. Tell your human; don't retry now.
402
Codice: insufficient_credits
Cosa fare: The credit balance can't cover the request (the body has balance_usd and required_usd). Run `billing topup --amount-usd 20` and send your human the approval_url.
402
Codice: daily_cap_exceeded
Cosa fare: An operator-set daily cap on this account is reached. Resets 00:00 UTC. Tell your human.
402
Codice: credits_required_for_batches
Cosa fare: Batches are paid from prepaid credits. Run `billing topup --amount-usd 20`, then retry once your human approves.
402
Codice: credits_required_for_fine_tuning
Cosa fare: Fine-tuning is paid from prepaid credits. Run `billing topup --amount-usd 20`, then retry once your human approves.
409
Codice: too_many_pending_topups
Cosa fare: The account already has 2 unpaid approval links. Ask your human to pay one (`billing status` lists them), or wait for them to expire.
409
Codice: daily_topup_limit
Cosa fare: Top-ups are limited to $2,000 per account per rolling 24 hours, open links and auto-reloads included. Retry with at most available_usd from the body, or wait.
403
Codice: approval_required
Cosa fare: Turning auto-reload on or raising it needs your human. Run `billing auto-reload setup --below <usd> --amount <usd>` (a link your human approves; nothing is bought) and give them the approval_url. Disabling or lowering needs no approval.
402
Codice: free_tier_key_limit
Cosa fare: Accounts that haven't bought credits have 5 active keys. Revoke one (`keys revoke <id>`) or buy credits.
402
Codice: free_tier_limit
Cosa fare: Accounts that haven't bought credits can't raise budgets or rate limits. Buy credits first (`billing topup --amount-usd 20`).
409
Codice: fine_tuning_requires_self_hosted
Cosa fare: This base model isn't served on our own GPUs in your region, so it can't be fine-tuned here. Pick another base model.
409
Codice: model_not_live
Cosa fare: That model isn't served in your region yet. Pick one from `models --live`.
400
Codice: invalid_video_url
Cosa fare: video_url must be a public https URL or a data:video/mp4 (webm, mov) URL within the size limit.
403
Codice: insufficient_scope
Cosa fare: This key lacks the scope. Use the default key from init.
403
Codice: account_suspended
Cosa fare: Stop. Tell your human to email hello@scaledthought.com.
404
Codice: model_not_found
Cosa fare: Not live here. Pick an id from `models --live` or `GET $ST_BASE_URL/models`.
404
Codice: not_found
Cosa fare: Wrong path. ST_BASE_URL already ends in /v1; append /chat/completions.
421
Codice: wrong_region
Cosa fare: The key belongs to the other region. Use the `base_url` in the error body; remove any hard-coded host.
429
Codice: rate_limit_exceeded
Cosa fare: Wait `Retry-After` seconds, then retry.
429
Codice: capacity_exhausted
Cosa fare: Canada: every replica of the model is busy and Canadian requests never overflow to another country. Wait `Retry-After` seconds and retry with backoff, or use another model.
400
Codice: invalid_webhook_url
Cosa fare: Webhook URLs must be public https endpoints on port 443 (no other port, no private, loopback or internal hosts). Fix the URL.
409
Codice: too_many_webhooks
Cosa fare: An account has at most 5 webhook endpoints. Remove one (`webhooks remove <id>`) first.
404
Codice: webhook_not_found
Cosa fare: No such webhook on this account. List them with `webhooks list`.
503
Codice: webhooks_unavailable
Cosa fare: Webhooks aren't enabled in this region yet. Poll `GET /v1/account` for `notices` instead.
502
Codice: upstream_error
Cosa fare: Transient. Retry with backoff, or use another model from `models --live`.
503
Codice: region_not_open
Cosa fare: The Canada region isn't open yet. Check with your human that US hosting is acceptable, then use `init --region us` and the US host.
503
Codice: service_unavailable
Cosa fare: Transient. Retry in a few seconds.
exit 1
Codice: no_key
Cosa fare: No ST_API_KEY in the environment or ./.env. For an existing account run `login`; for a new one, `init --region us`.
exit 1
Codice: key_exists
Cosa fare: login: this folder already has a key. Use it, or pass --force to replace it.
428
Codice: authorization_pending
Cosa fare: login --wait: your human hasn't typed the code yet. Run it again (codes last 10 minutes).
410
Codice: expired_token
Cosa fare: The connect code expired. Run `login` again for a new one.
409
Codice: already_claimed
Cosa fare: A connect code works once. Run `login` again (or ask for a new connect line).
403
Codice: access_denied
Cosa fare: Your human denied the connection. Ask them before trying again.
exit 1
Codice: region_mismatch
Cosa fare: A key from the other region already exists here. Use it, or ask your human before creating a second account elsewhere.
exit 1
Codice: wrong_region_endpoint
Cosa fare: ST_BASE_URL / ST_API_URL points at the other region. Unset it. Nothing was sent.
exit 1
Codice: network_error
Cosa fare: Couldn't reach the API. Check the network, then retry.
exit 1
Codice: bad_region
Cosa fare: Use `--region us`. Canada (`ca`) is coming soon.
exit 2
Codice: usage_error
Cosa fare: Unknown command, flag or missing argument. Run the command with --help.

Agent view · paste this into your agent

Apre il tuo agente con il prompt già scritto. Tu premi Invio.

Link diretti alle app che hai installato. Claude e Claude Code sono marchi di Anthropic; Codex è un marchio di OpenAI. ScaledThought non è affiliata a nessuna delle due né approvata da esse.

Agents can read the whole site as markdown at scaledthought.com/llms.txt.