Every error uses a standard HTTP status code and returns the same JSON body. Branch onDocumentation Index
Fetch the complete documentation index at: https://agent37.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
code (it’s stable) and show message to a human.
Error body
Failed requests return anerror object. code and message are always present; param and hint appear when they help.
A stable, machine-readable identifier. Branch on this, never on
message or the HTTP status alone.A human-readable description. Safe to show, but don’t parse it.
The request field that was invalid. Present on
validation_error.A suggested next step, when one applies.
Codes
| Code | HTTP | Meaning |
|---|---|---|
invalid_api_key | 401 | Missing, malformed, or revoked key. |
insufficient_balance | 402 | Balance cannot cover this. Add funds to create instances or run managed calls. |
instance_cap_reached | 402 | This instance hit its managed-usage cap. Raise managed_credit_cap_usd. |
instance_not_found | 404 | No instance with that id on your account. |
instance_not_running | 409 | The instance is not running. Wait for running, then retry. |
session_busy | 409 | A response is already running on this session. Cancel first or use another. |
insufficient_capacity | 503 | No room to provision right now. Safe to retry. |
rate_limited | 429 | Too many requests. Retry after Retry-After. |
validation_error | 400 | A request field was invalid. See param. |
Handle them
Readcode, then act. Billing codes (402) point your end user to the dashboard; 429 and 503 are retryable.
insufficient_balance and instance_cap_reached are billing limits, not bugs. Balance and top-ups live in the dashboard. There is no balance API. See Billing for how managed spend is capped.Notes per code
invalid_api_key (401)
invalid_api_key (401)
The
Authorization header is missing, malformed, or the key was revoked. Send Authorization: Bearer sk_live_... and keep the key server-side. Rotate keys in the dashboard.session_busy (409)
session_busy (409)
A session runs one response at a time. Sending new input while one is in flight returns this. Cancel the running turn with
POST /v1/responses/{id}/cancel, or open another session.validation_error (400)
validation_error (400)
A request field was invalid. Read
param to find which one, then check the field against Send a message or Instances.Next steps
Send a message
The core call, its fields, and the response shape.
Billing
Prepaid balance and per-instance managed-usage caps.
Streaming events
Render text, reasoning, and tool activity live.
Instances
Create, size, and manage the agent’s computer.