Aibubu
Visit Aibubu ↗
Task management

Errors & Retry

Practical error handling, idempotency, and backoff retry rules for async generation endpoints, task polling, and webhooks.

POST/v1/generations

Client requests

Retry when:

  • request timed out before you received a response
  • network connection dropped
  • the server returned a retriable 5xx, or a 429 with retryable: true

Use the same Idempotency-Key when retrying a create call.

Error shape and common codes

{"error":{"code":"invalid_request","message":"...","request_id":"req_...","retryable":false}}
  • request_id matches the X-Request-Id response header; include it when contacting support.
  • retryable: true means waiting and retrying with the same idempotency key can succeed; false means fix the request, permissions, or balance first.
  • 429 and some 503 responses carry Retry-After in seconds; wait at least that long.
HTTPCommon codeAction
400invalid_request, quote_errorFix model or parameters; do not retry unchanged
400invalid_callback_urlcallback_url must be a public https URL (max 2048 characters); fix it before resubmitting, do not retry unchanged
400callback_secret_requiredSet the workspace callback_url signing secret on /console/webhooks before using callback_url; see Webhooks
400group_param_not_allowedThe parameter value is not allowed for your group; adjust it
401unauthenticatedCheck the Bearer API key
402insufficient_balanceThe key's workspace lacks API balance; add funds to the API wallet before calling again and do not blindly retry; read api_credits from GET /v1/user/balance
403scope_forbiddenGrant the required scope or use another key
403ip_not_allowedThe request IP is outside the key's IP allowlist; update the key's allowed IPs in the console
403model_not_allowedThe key has a model allowlist that excludes this model; update the key's allowed models in the console
404model_not_found, task_not_foundCheck IDs and workspace ownership; use the id returned by GET /v1/models
409idempotency_conflictUse a new key for a different request body
409idempotency_in_progressFollow Retry-After, then retry the same key and body
429group_rate_limited, risk_limitedPer-minute request or risk window is full; back off for Retry-After, then retry
429group_limit_exceededConcurrent-task, daily credit, or request quota is full; Retry-After can be long (for example until the next day). Wait for in-flight tasks or raise the key's limits
429budget_exceededThe API wallet's daily or monthly budget is exhausted; wait for the budget period to reset or ask a workspace admin to adjust the API wallet budget
503no_available_route, upstream_provider_error, gateway_errorNo route is available right now or the limiter is down; retry a limited number of times after Retry-After with the same idempotency key
Other 5xxServer errorRetry a limited number of times with the same idempotency key

Rate-limit headers

When the API key has a requests-per-minute (RPM) limit, responses to requests that count against it (image and video generation and text model calls) include:

HeaderMeaning
X-RateLimit-Limit-RequestsRequests allowed in the current window
X-RateLimit-Remaining-RequestsRequests left in the current window

Read endpoints such as model lists, quotes, and task lookups do not count against RPM and omit these headers. They are also omitted when the key has no RPM limit or the request was rejected before it counted.

Task polling

Treat these separately:

  • transport failure: retry the poll
  • task failure: inspect the business error payload and decide whether to resubmit

Webhook receivers

If you return non-2xx, Aibubu will retry until the retry budget is exhausted.

Return 2xx only after:

  • signature passes
  • request is accepted for internal processing