Caption an image
A folder of ten thousand untagged photos is a search problem before it's anything else — you can't find what you can't describe. The image captioning API looks at a picture and returns a plain sentence stating what's actually in it, giving every image a searchable, sortable piece of text attached to it. Send an image, get back a caption you can index, filter or feed into another system.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
A different job than alt text
It's worth being precise about what this endpoint is for: a caption describes the content of an image for search, cataloging, moderation or feeding a downstream system — it is not written to satisfy accessibility markup requirements, though it often overlaps in substance. Where alt text is written to be read aloud in place of an image, a caption from this endpoint is written to be indexed, searched, filtered and compared, which shapes it toward consistent, literal descriptions of subject and scene.
What comes back
POST an image to /image/caption and the task returns a plain-language sentence identifying the main subject and setting — a dog running on a beach, a printed invoice on a wooden desk, three people at a conference table. The description is generated directly from the image content, not from a filename or any metadata attached to it, which matters enormously for any photo that arrived with a meaningless auto-generated filename from a camera or phone.
The problem it actually solves
Stock photo libraries, digital asset management systems and internal photo archives all share the same failure mode: search only works if something described the image in text, and manually captioning tens of thousands of files never happens. This endpoint turns an unsearchable pile of JPEGs into a dataset a normal text search can query, which is the difference between finding a photo in seconds and scrolling through folders for an hour.
How it plugs into a larger system
Because captioning runs asynchronously, it's typically the first stage of a bigger pipeline rather than a standalone step: a caption feeds a search index, gets scanned by a moderation rule for flagged terms, or gets stored as a metadata field next to the file. A batch of images gets submitted, results land by webhook as each one finishes, and downstream systems pick up captions as they arrive instead of waiting for the whole batch to complete.
Pricing scaled to real usage
The endpoint charges a small flat fee per request plus a per-image amount, so captioning a single photo and running an entire archive through it both cost in direct proportion to the work done. Failed attempts retry automatically up to three times and are never billed, so a large archive run only accrues cost for captions that were actually produced.
What you can do with it
Digital asset library search
A media company captions an archive of untagged photos so its internal search tool can return relevant images by subject instead of relying on cryptic filenames.
Content moderation pre-screening
A platform captions user-uploaded images as a first pass, feeding the caption text into a rule-based filter before an image is queued for further review.
Stock photo catalog tagging
A stock photography site generates captions for newly ingested images to auto-populate searchable keywords and descriptions for buyers.
Social listening image analysis
A brand monitoring tool captions images shared in posts to understand visual content alongside text mentions, without manual review of every photo.
FAQ
What's the difference between the image captioning API and alt text generation?
Captioning produces a literal description of an image's content for search, cataloging or moderation, while alt text is specifically formatted for accessibility use inside an alt attribute; the content can overlap but the intent differs.
What does a typical caption look like?
A short, plain-language sentence naming the main subject and setting, such as 'a dog running on a beach' — generated from the actual image content, not the filename or metadata.
Can I caption a large archive of images in bulk?
Yes, each image is one request and the task is asynchronous, so a script can submit an entire archive and collect captions via webhook as each one completes.
What image formats does the captioning API accept?
JPEG, PNG and WebP images are accepted as input.
Is the image captioning API free to use?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
How do I get the caption back — polling or webhook?
The task returns a task_id immediately and runs asynchronously; the caption arrives via signed webhook, or you can retrieve it from a signed link valid for 24 hours.
Can I use captions for content moderation?
Yes, many teams feed the returned caption text into their own moderation rules or keyword filters as a first pass before deeper review.
What happens if a caption generation fails?
The task retries automatically up to three times before returning a clear error, and a failed request is never charged.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/image/caption \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"image":"https://ejemplo.com/imagen.jpg"}'const res = await fetch("https://api.kit.forhosting.com/image/caption", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"image": "https://ejemplo.com/imagen.jpg"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/image/caption",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"image": "https://ejemplo.com/imagen.jpg"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/image/caption", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"image":"https://ejemplo.com/imagen.jpg"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"image":"https://ejemplo.com/imagen.jpg"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/image/caption", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"image": "https://ejemplo.com/imagen.jpg"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "image.caption",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 15 |
max_megapixels | 12 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
422 | task_failed | The task failed after 3 retries. You are never charged for it. |