POST /image/alt or mynth.image.alt() to generate concise alt text for existing image URLs. Submit 1 to 10 URLs per request. By default the REST endpoint is synchronous — results come back in the same response. Set "sync": false to queue the task and receive a 202 with a task ID instead.
This endpoint is for images you already have (including ones not generated by Mynth). For content classification of existing images, use Rate Image Content (POST /image/rate).
Pricing
/image/alt costs $0.0004 per image. Only images that successfully receive alt text are charged.
The full amount for all submitted URLs is reserved up front. If a URL fails, the unused reserve for that image is released. If your balance cannot cover the full reserve, the request returns 422 INSUFFICIENT_BALANCE.
Generate alt text with the SDK
getAltTexts() returns only successful items. Use getErrors() for failures, or inspect result.results item by item.
Local files
Passfiles instead of urls when the image is local. The SDK uploads first, then calls /image/alt with the resulting URLs. See Upload input images.
Handle per-image results
Images are processed in parallel. A failure on one URL does not fail the others. The task still completes with a per-URLresults array.
Success item:
| Code | Meaning |
|---|---|
FETCH_FAILED | The image could not be downloaded from the URL. |
ALT_GENERATION_FAILED | The image was fetched but alt text generation failed. |
UNKNOWN_ERROR | An unexpected error. Retry if it persists. |
task.cost reflects successful URLs only.
Constraints
| Constraint | Limit |
|---|---|
| URLs per request | 1 to 10 |
| Alt text length | 1 to 160 characters |
Generate alt text with REST
sync defaults to true. Completed response:
202 pending. If the task fails entirely, it returns 500. See Image Alt Request for full response shapes.
Start now, wait later
UsealtAsync() when you want to create the task now and wait later:
"sync": false:
202 with a task ID. Poll /tasks/:id/status and /tasks/:id/result, or listen for task.image.alt.completed / task.image.alt.failed webhooks.
See Async and polling and Use webhooks.
How alt text fits
- You submit image URLs (or upload files via the SDK).
- Mynth fetches each image and generates short alt text with a vision model.
- Each URL gets
status: "success"andalt, orstatus: "failed"anderror. - Billing charges only successful items; reserved balance for failures is released.