Reference

#Errors and limits

How AI Studio reports problems, what each status and code means, and which limits apply. The page for each API has the full error table per endpoint; this page is the overview.

{BASE_URL} = https://studio.scaletechsolutions.ai/api/v1

#Error format

Errors come back with an HTTP status and a JSON body with detail:

{"detail": "Session not found."}

Some errors add a stable code you can branch on, either next to detail or inside it:

{"detail": "This agent is unavailable right now. Please try again later.", "code": "agent_budget_exceeded"}

Validation errors (422) use FastAPI's standard list:

{"detail": [{"loc": ["body", "message"], "msg": "Field required", "type": "missing"}]}

An unexpected server error (500) carries a request_id. Include it, with the time, when you report a problem:

{"detail": "An unexpected error occurred. Our team has been notified.", "request_id": "1c672aa8-..."}

#Status codes

StatusMeaningWhat to do
200 / 201Success (201: something was created)
202Accepted: the work was queued (a webhook trigger, a folder sync)Check the result later; see the API's page.
204Success, no body (a delete or revoke)
307Redirect to a short-lived download URL (knowledge base downloads)Follow redirects.
400The request can't be done as asked (unsupported file type, disabled trigger, a connection that needs reconnecting)Read detail; fix the input or the setup.
401Not authenticated: no Authorization: Bearer header, or an invalid or revoked keyCheck the key and the header.
402A spending limit is reachedTry again after it resets. See Spending limits.
403Authenticated, but not allowed (a key used for another agent, a missing permission)Use the right key, or ask the owner for access.
404Not found, or not yours (several routes answer 404 for something that belongs to someone else)Check the ids.
409Conflicts with what exists (a duplicate name, a folder already connected)Use the existing item or another name.
422Invalid input (missing field, wrong type, value out of range)Fix the request using the detail list.
429Too many requests (only where noted)Wait and retry with backoff.
500The run or request failed on our sideRetry; if it persists, report the request_id.
502An outside system AI Studio depends on did not answer (for example your database)Retry later; check that system.

#Agents API

Common to every /public/agents route:

StatusdetailCause
401"Not authenticated"No Authorization: Bearer header
401"Invalid or revoked API key"Unknown or revoked key, or its creator's account is deactivated
403"This API key does not have access to this agent."The key belongs to another agent
404"Agent not found."The agent was deleted or deactivated, or the key's creator lost access to it
404"Session not found."Wrong session, another agent's, or created by another key

POST .../chat also returns 402 (spending limit) and 500 "An error occurred during agent execution.".

#Errors while streaming

POST .../stream reports a failure during the turn as an error event, not an HTTP status:

{"type": "error", "code": "ai_rate_limited", "message": "..."}
codeMeaningWhat to do
ai_key_invalidThe AI provider rejected AI Studio's model keyTell the agent's owner; nothing to fix on your side.
ai_rate_limitedThe AI provider is rate limitingRetry after a short wait.
ai_request_rejectedThe AI provider refused this request; message may say why (for example an image too large)Change the input.
ai_unavailableThe AI provider is down or timed outRetry later.
agent_budget_exceededThe agent's spending limit is reachedRetry after it resets.
agent_allowance_exceededYour key's allowance on this agent is used upRetry after it resets, or ask the owner to raise it.
org_budget_exceededThe organization's spending limit is reachedRetry after it resets.
org_member_limit_exceededThe key owner's personal limit in the organization is reachedRetry after it resets.
chat_failedAnything elseRetry; report it if it persists.

#Knowledge base API

Statusdetail (examples)Cause
400"Unsupported file type. Supported formats: ..."The file type can't be ingested
400"Your ... connection has expired. ..." with header X-Reconnect-RequiredThe cloud account behind a folder source must be reconnected in the app
401"Not authenticated" / "Invalid or revoked API key"As above
404"Knowledge base not found", "Document not found", "Folder source not found"Wrong id, or not this key's knowledge base
409"'<name>' is already connected to this knowledge base."The folder is already a source

Use the X-Reconnect-Required header rather than the message text to detect a connection that needs reconnecting. Details: Knowledge base API.

#Webhook triggers

StatusdetailCause
202"Webhook received and task dispatched."Accepted; the run happens in the background
202"Webhook already received and processing."Same Idempotency-Key sent again; nothing new runs
400"Trigger is disabled"The trigger is switched off
404"Webhook trigger not found or unauthorized"Wrong id or secret, or not a webhook trigger

A 202 only means the run was queued. Whether it succeeded is in the trigger's run history in the app. See Webhooks and triggers.

#Spending limits

AI Studio can cap what is spent on AI, per day and per month, at several levels:

Checked before each turn Agent limitset by the ownerdaily or monthly Key allowanceset by the ownerper API key Organizationset by an adminwhole org Member limitset by an adminkey creator Turn runsall clear Any limit reached: 402, or an error event Limits reset at the start of the next UTC day or month.
A turn already running always finishes. Public callers never see amounts or reset times.
LimitSet byApplies to
Agent limitThe agent's ownerEverything the agent spends, from any caller
Allowance per API keyThe agent's ownerWhat one key may spend on the agent
Organization limitAn organization adminAll spending in the organization
Member limitAn organization adminOne member's spending

When a limit is reached, new turns are refused: 402 from /chat with a code, or an error event from /stream. Public callers always get the same neutral message ("This agent is unavailable right now. Please try again later."); amounts are never shown. A limit is checked before a turn starts, so a turn already running finishes.

Limits reset at the start of the next UTC day or month. Only the owner or an admin can change them, in the app.

#Size and other limits

Time limits at a glance

Seconds, drawn on a logarithmic scale so short and long limits fit together.

DB lock wait
2 s
DB connect
10 s
DB query (default)
15 s
MCP tool call
30 s
DB query (max)
60 s
Webhook agent run
600 s
1 s10 s100 s1000 s
DatabaseMCPTriggers
WhatLimit
Agent run started by a webhook trigger600 seconds, then it is stopped and the execution marked failed
Schedule triggersAt least 5 minutes between runs
Knowledge base: text indexed per documentThe first 40,000 characters (spreadsheets excepted)
Knowledge base: scanned PDFsOCR reads up to 80 pages
Knowledge base: files synced from a cloud folder200 MB per file
Knowledge base: folder sync interval60 to 10,080 minutes (1 hour to 1 week)
Custom MCP tools30 seconds per call
Database connections (setup routes)10 requests per minute per user
Database queriesSee Databases for row caps and timeouts

#Getting help

When you report a problem, include:

  • the time (UTC) and the endpoint,
  • the request_id from a 500, if there is one,
  • the agent id and session id (agents), or the document id (knowledge bases).
AI Studio developer documentation. Times are UTC and IDs are opaque strings.