Generate a caption, alt text, tags, and dominant colors for an image. $0.02 per request.
Send a photo or graphic. Get back a natural-language caption, concise accessibility alt text, keyword tags, dominant colors, and whether the image contains legible text.
| Method | POST |
|---|---|
| Path | /caption |
| Content-Type | multipart/form-data |
| field | required | description |
|---|---|---|
file | yes | PNG, JPEG, WEBP, or GIF image, max 8MB |
curl -X POST https://image-captioner.pdfextractapi.workers.dev/caption \
-F "file=@photo.jpg"
{
"caption": "A golden retriever running across a grassy park on a sunny day.",
"alt_text": "Golden retriever running across a park",
"tags": ["dog", "golden retriever", "park", "grass", "outdoors", "running"],
"dominant_colors": ["green", "gold", "blue"],
"contains_text": false
}
Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: missing_input, file_too_large, unsupported_media_type.
This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.