Skip to main content

Alt text generator API

Upload an image and get alt text for screen reader users, with a shorter alternative, or write your own with the checklist. We don't keep your image.

  • Endpoint: POST https://postboost.co/app/api/tools/alt-text-generator (operationId generateAltText)
  • Web tool: postboost.co/tools/alt-text-generator
  • Token: required. A new generation spends 1 AI credit of the workspace you name (or your active workspace); a repeated identical request is answered from the cache for free. A scoped API key needs the ai ability and pays with its own workspace
  • MCP: tool generate-alt-text on https://postboost.co/mcp/tools (listed only with a token)

Request​

FieldTypeDefaultDescription
image_base64stringThe image itself, base64-encoded without a data: prefix: JPEG, PNG, WebP or GIF (first frame), up to 5 MB. On the API you can upload the file as image in a multipart/form-data body instead. A request to the MCP server at /mcp/tools may be at most 1.5 MB, so send larger images as image_url there. Send this or image_url.
image_urlstringA public https URL of the image, up to 5 MB. Fetched once and never stored; each fetch also counts against the daily limit of the tools that load a URL. Send this or image_base64.
contextstringOptional: what the post is about, so the text describes what matters for it.
lengthstring: short, detailed"short"short (up to 125 characters) or detailed (up to 250).
workspacestringUUID of the workspace whose AI credits pay for the call. Default: your active workspace (a scoped API key: its own workspace).

Call it​

curl -X POST https://postboost.co/app/api/tools/alt-text-generator \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"image_url":"https://example.com/images/sourdough.jpg","context":"our bakery opens on Saturday","length":"short"}'

This tool needs a token: send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).

Response​

{
"alt_text": "A golden sourdough loaf cooling on a wire rack in a bakery window",
"short_alt_text": "Sourdough loaf on a cooling rack",
"credits_spent": 1,
"cached": false
}

With MCP​

Connect https://postboost.co/mcp/tools (setup) and ask, for example: Write alt text for an image with AI (needs a token, spends AI credits) with the PostBoost generate-alt-text tool.

MCP requests are capped at 128 KB without a token and 1.5 MB with one; send bigger requests to the API (7 MB).

Errors​

StatusWhen
401No token, or an invalid one. The body has register_url to create a free account.
403workspace is not a workspace you belong to, or your account has no workspace, or a scoped API key lacks the ai ability or is bound to another workspace (code: insufficient_scope).
413The JSON body is larger than 7 MB.
422A field is invalid; the body lists the errors per field.
429The workspace has no AI credits left this billing cycle (code: ai_credits_exhausted, upgrade_url), or the per-minute limit is reached.
502The AI provider failed or timed out. No credit was spent.
503AI tools are switched off right now.