Image Captioner

Generate a caption, alt text, tags, and dominant colors for an image. $0.02 per request.

What it does

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.

Endpoint

MethodPOST
Path/caption
Content-Typemultipart/form-data

Fields

fieldrequireddescription
fileyesPNG, JPEG, WEBP, or GIF image, max 8MB

Example

curl -X POST https://image-captioner.pdfextractapi.workers.dev/caption \
  -F "file=@photo.jpg"

Example response

{
  "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

Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: missing_input, file_too_large, unsupported_media_type.

Payment

This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.

Try it in your browser