Skip to navigation

Why is there no image after HTTP 201?

HTTP 201 from POST /v1/images/tasks means the gateway accepted and queued the image task, not that rendering finished. Save data.id on the order or asset record, then poll GET /v1/tasks/{task_id} until the task reaches a terminal status.

Poll the task lifecycle

Wait data.poll_after_seconds (5 seconds for image tasks) between status checks. Polling GET /v1/tasks/{task_id} is not rate limited.

curl -sS 'https://api.beatapi.io/v1/tasks/<task_id>' \
-H "Authorization: Bearer $BEATAPI_API_KEY"
  • queued or processing: Keep showing progress and poll again after data.poll_after_seconds.
  • succeeded: Read the hosted image URL from data.output.media[].url (or data.output.r2_url) and download the file to permanent storage.
  • failed: GET /v1/tasks/{task_id} still responds with HTTP 200. Read data.error_code, data.error_message, and data.retryable, then inspect the input on the asset record.

Credits on failed tasks

When an accepted task ends in failed, BeatAPI refunds the reserved credits automatically: usage.credits_charged and usage.credits_settled are 0, and usage.credits_refunded records the returned amount.

See the image request reference for model inputs and the task lifecycle for status and output fields. If the create request timed out before returning a task ID, follow the idempotent retry instructions.

Back to AI Models questions.