200. Set "sync": false to queue the task and receive a 202 with a task ID for polling instead. In sync mode, if the task does not finish within the sync timeout the endpoint returns a 202 pending response, and if the task fails it returns a 500.
Request body
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
urls | array | required | Image URLs to generate alt text for. Minimum 1, maximum 10. |
sync | boolean | true | When true, wait for results and return them inline. When false, return a 202 pending task. |
Response body
200 - completed
Returned when sync is true (the default) and the task finishes within the sync timeout.
| Field | Type | Notes |
|---|---|---|
data.task | object | Task record created for this request. |
data.results | array | One entry per submitted URL, in the same order. Each entry is a success or failure item. |
202 - pending
Returned when sync is false, or when sync is true but the task did not finish within the sync timeout. Use the task id to poll for completion.
Success item
| Field | Type | Notes |
|---|---|---|
status | string | Always success. |
url | string | The submitted image URL. |
alt | string | Generated alt text. |
Failure item
| Code | Cause |
|---|---|
FETCH_FAILED | The image could not be downloaded from the provided URL. |
ALT_GENERATION_FAILED | The image was downloaded but alt text generation failed. |
UNKNOWN_ERROR | An unexpected error occurred. Should not normally occur; treat as a bug and retry. |
Limits
| Constraint | Value |
|---|---|
| URLs per request | 1-10 |
| Alt text length | 1-160 chars |
Pricing
Each URL is priced at **0.0004) is reserved from your account balance before processing begins. You are charged only for URLs that successfully receive alt text - the reserved balance for any failed items is released. If your balance is insufficient to reserve the full amount, the request returns422 INSUFFICIENT_BALANCE.
Error responses
| Status | Body | Cause |
|---|---|---|
400 | { success: false, errors: [...] } | Request body fails schema validation. |
401 | { code: "UNAUTHORIZED", ... } | Missing or invalid API key or OAuth access token. |
422 | { code: "INSUFFICIENT_BALANCE" } | Account balance is too low to reserve the full cost. |
500 | { code: "UNKNOWN_ERROR" } | sync is true and the alt text task failed. Use async mode or retry to poll the task. |