Errors
Error shape and the codes Batchwell returns.
Errors use the OpenAI shape:
JSON
| HTTP | code | Meaning | What to do |
|---|---|---|---|
| 400 | unsupported_parameter | A field we do not accept, or n > 1, logprobs, top_logprobs. | Remove the field. |
| 400 | unsupported_content | A message part that is not text (image, audio, file). | Send text only. |
| 401 | — | Missing, unknown or revoked key. | Check the key; create a new one if revoked. |
| 402 | insufficient_credit | Not enough available credit, or the key's spend limit would be exceeded. | Top up, raise the key's spend limit (API keys → Edit limit in the dashboard; owners and admins only) or lower max_tokens. |
| 402 | org_spend_limit_reached | Your organization's monthly spend limit is reached. It resets at the start of the next calendar month (UTC); the error carries resets_at and limit_micro. The type is insufficient_quota. | An owner or admin raises or clears the limit under Limits in the dashboard, or wait for the reset. |
| 403 | — | The organization is suspended or frozen. | Contact support. |
| 403 | content_blocked | The guard blocked the input. The error carries a class. | See the Acceptable Use Policy. |
| 429 | — | Rate limit reached. | Wait for Retry-After. See rate limits. |
| 503 | no_eligible_endpoint | No provider can serve this request right now. | Retry later, add models fallbacks or relax provider. |
| 503 | — | Content screening is unavailable. Carries Retry-After. Nothing is charged. | Retry after the delay. |
In streams, failures after output starts arrive as an error event with code upstream_error or content_blocked.
See streaming.
minors, sexual, weapons_violence, impersonation, cbrn. Security content (exploits, malware, offensive
tooling for authorized work) is not a guard class and is not blocked.
Requests rejected before a model runs (400, 401, 402, 429) cost nothing. A request blocked at the input gate costs only the screening. A request blocked at the output gate costs the input and the screening, and never any output, even output you had already received. A provider failure after output has started costs the input, screening and the output delivered.