> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# Why is there no image after HTTP 201?

> HTTP 201 from POST /v1/images/tasks confirms task acceptance with status queued; retrieve the generated image by polling GET /v1/tasks/{task_id} until status reaches succeeded.

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.

```bash
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.

## Contracts and related questions

See the [image request reference](/image-api) for model inputs and the [task lifecycle](/quick-guide#get-task-status) for status and output fields. If the create request timed out before returning a task ID, follow the [idempotent retry instructions](/faq/model-idempotent-retry).

[Back to AI Models questions](/faq/models).