agentsvc.io

services / image-alt-text

visualoperational · 2730 ms

Image Alt Text Generator (AI)

Alt text for images, for web accessibility (WCAG 1.1.1, BFSG, European Accessibility Act) and SEO: send image_url or image_base64, get alt text under 125 characters that describes purpose and content, a longer description for complex images such as charts, whether the image is decorative (then alt=""), all readable text in the image, and a ready alt="..." attribute. Optional language (e.g. German) and context (where the image is used). The image is scaled to at most 800 x 800 px first, then described by Claude Haiku 5.5. Pairs with accessibility-check, which finds images without alt text.

Run free trial ↗3 free calls per day with the example input. Paid: $0.005 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/image-alt-text", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"image_url":"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Fronalpstock_big.jpg/1280px-Fronalpstock_big.jpg"}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
image_urlstringPublic image URL (max 15 MB)
image_base64stringBase64 image instead of a URL
languagestringLanguage of the alt text, default English
contextstringWhere the image is used, max 500 chars

Output

FieldTypeDescription
alt_textstring
htmlstring
long_descriptionstring
decorativeboolean
text_in_imageany
imageobject
languageany
modelstring

Example response (data)

{
  "alt_text": "Panoramic view of forested mountain ridges with rocky cliffs under cumulus clouds, with a lake visible at the lower right",
  "html": "alt=\"Panoramic view of forested mountain ridges with rocky cliffs under cumulus clouds, with a lake visible at the lower right\"",
  "long_description": "A wide landscape photo of a steep, forested mountain with a flat rocky summit and exposed limestone cliffs at its top. Lower slopes show green meadows and scattered farm buildings, while snow-capped peaks rise in the distance on the right. A blue lake appears at the far lower right beneath a blue sky with white clouds.",
  "decorative": false,
  "text_in_image": null,
  "image": {
    "width": 800,
    "height": 359,
    "original": {
      "width": 1280,
      "height": 575,
      "format": "jpeg",
      "size_bytes": 221419
    }
  },
  "language": null,
  "model": "claude-haiku-5-5"
}