Skip to navigation

Errors

View as Markdown

BeatAPI reports every failure with one of a fixed set of codes. Branch on code, or on retryable; message is an English sentence for a person that states the cause. BeatAPI never names the supplier behind a model and does not pass on raw upstream response bodies; the one exception is an English input-validation sentence from the model on the text endpoints, relayed so you can fix the input. Keep request_id and contact support with it when a failure is not explained here.

The error object

Every BeatAPI endpoint — image and video tasks, GET /v1/tasks/{task_id}, capabilities, workflows, /v1/systemone (and its alias /v1/decisions), /v1/moderations, /v1/social-data/call and /v1/web/* — answers an error with the same envelope:

{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded: at most 10 successful requests per 1 minute(s). Retry after 60 seconds.",
"retryable": true,
"request_id": "202611260307541272151438268d9d6mNDNwzi9",
"retry_after_seconds": 60
}
}
FieldPresentMeaning
codeAlwaysA code from the table below. This is the part to branch on.
messageAlwaysAn English sentence that states the cause; for bad_request it names the field. Written for people and logs — do not parse it.
retryableEvery code in the table belowtrue when the same call may succeed later (every 429, 500 and 503 code in the table). false when it will fail again until you change the request, the key or the balance. Never loop a call whose retryable is false. It may be absent only for a code that is not in the table.
request_idAlwaysThe ID of this call, also sent in the X-BeatAPI-Request-Id response header. Keep it; support finds the call by it. See Request IDs.
retry_after_secondsOnly on 429 rate_limit_exceededSeconds to wait. The same value is sent in the Retry-After header. No other code carries it: a 503 has no known wait, so retry it with backoff.

POST /v1/chat/completions, POST /v1/responses and POST /v1/messages use this envelope for failures before the model is called and keep their SDK’s own error shape for failures during the call; see Text endpoints. The Gemini-native endpoints (/v1beta/...) and GET /v1/models use a different, simpler shape; see the same section.

The capabilities endpoints (/v1/capabilities/*) add fields to the envelope that other endpoints do not carry: docs, a link to the error-handling reference for agents (https://beatapi.io/skill-refs/errors.md), suggestions, the closest published references when a capability is not found, and next, a ready-made follow-up call.

{
"error": {
"code": "not_found",
"message": "Capability not found. Copy a reference exactly as Search returns it.",
"retryable": false,
"request_id": "202611260310388618788488268d9d6TXqLvRa1",
"docs": "https://beatapi.io/skill-refs/errors.md",
"suggestions": ["model:seedance-2.5-flash", "model:seedance-2.5"]
}
}

POST /v1/moderations uses this envelope as well. On that one endpoint the error object also carries OpenAI’s type and param (param is always null), so the OpenAI SDKs raise their usual exceptions; see Moderation API.

Request IDs

Every response carries a request_id: in the error body, in the task object, and in the