Skip to main content
Five API reports problems in two places:
  • Request errors answer the HTTP request itself with a 4xx or 5xx status and an error body. Nothing is created and nothing is charged.
  • Task failures happen after a task was accepted. The task ends with status: failed, its error explains why, and its credits are released.

Error format

Every error response has the same body:
New codes may be added over time. Handle an unknown code by its type and HTTP status.

Request errors

Task failures

A task that was accepted can still fail. Its error tells you why and whether a new attempt can succeed:
Failed tasks are never charged. To try again, create a new task (with a new Idempotency-Key); a failed task cannot be restarted.

Retry strategy

Retry only what can succeed:
  • 429 and 503: wait Retry-After seconds, then retry.
  • 500 and network errors: retry with exponential backoff.
  • Other 4xx: don’t retry. Fix the request.
Always retry with the same Idempotency-Key so a retry can never create a second task. See Idempotency.

Get help with an error

Email support@fiveapi.ai with the request_id of the failed request, or the task id of a failed task, and the time it happened.