Developer API

Our API allows you to generate high-quality, AI-powered alt text for images — programmatically.

You can integrate AltTextLab into your apps, CMS, or automation workflows to enhance accessibility, improve SEO, and streamline your image publishing process.

This documentation covers how to authenticate, send requests, and handle responses from the API.

Authentication

The AltTextLab API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard Settings.

Your API key must be included in the x-api-key header of each request:


x-api-key: YOUR_API_KEY

All API requests must be made over HTTPS. Requests made without a valid API key will return a 401 Unauthorized error.

Your API keys carry important privileges, so make sure to keep them secure. Do not share your API keys in public repositories, client-side code, or anywhere they might be exposed.

Example: CURL
    	
curl -X POST https://app.alttextlab.com/api/v1/alt-text/generate \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"imageUrl": "https://example.com/image.jpg", "lang": "en"}'
    	
    

Replace YOUR_API_KEY with your actual API key

Example: Node.js
    	
const fetch = require('node-fetch');

const response = await fetch('https://app.alttextlab.com/api/v1/alt-text/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    imageUrl: 'https://example.com/image.jpg'
    lang: 'en'
  })
});

const data = await response.json();
    	
    

Replace YOUR_API_KEY with your actual API key

Alt text generation

This endpoint lets you generate alt text for an image using AI, tailored to your preferred language, brand, and keywords.

The API takes a public image URL and returns a generated alt text along with metadata about the request. You can optionally guide the output by specifying a brand name or keywords to include.

Typical use cases include product feeds, blog platforms, content automation, and custom CMS integrations.

Endpoint

POST https://app.alttextlab.com/api/v1/alt-text/generate
Request headers

x-api-key: YOUR_API_KEY
Content-Type: application/json
Example: CURL
    	
curl -X POST https://app.alttextlab.com/api/v1/alt-text/generate \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"imageUrl": "https://example.com/image.jpg", "lang": "en", "brand": "Acme Co."}'
    	
    

Replace YOUR_API_KEY with your actual API key

Example: Node.js
    	
const fetch = require('node-fetch');

const response = await fetch('https://app.alttextlab.com/api/v1/alt-text/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    imageUrl: 'https://example.com/image.jpg'
    lang: 'en'
    brand: Acme Co.э,
    keywords: ['eco-friendly', 'minimalist']
  })
});

const data = await response.json();
    	
    

Replace YOUR_API_KEY with your actual API key

Request body

Send a JSON object with the following structure:

imageUrl (string, required)

The public URL of the image to process.

lang (string, required)

The language code for the generated alt text.
Example values: "en", "pl", "de".
You can find the full list of supported languages and their codes in the supported languages section.

style (string, optional)

Controls the tone and level of detail in the generated alt text.
Use one of the supported styles: `"descriptive"`, `"neutral"` (default), `"matter-of-fact"`, `"minimal"`
Learn more about writing styles →

brand (string, optional)

The name of the brand, manufacturer, or service provider shown in the image.
Used to add relevant context to the generated alt text.
Example: "Apple", "Starbucks", "IKEA"

keywords (string[], optional)

A list of keywords to include or emphasize in the alt text.
This is useful for SEO or content alignment.
Example: ["eco-friendly", "minimalist"]

Example: Request body
    	
{
  "imageUrl": "https://example.com/image.jpg",
  "lang": "en",
  "style": "neutral",
  "brand": "Acme Co.",
  "keywords": ["eco-friendly", "minimalist"]
}
    	
    
Response body

A successful response returns a JSON object with the following structure:

id (string)

A unique identifier for the alt text generation request.

imageUrl (string)

The original image URL that was submitted.

lang (string)

The language used for the generated alt text. Matches the lang field from the request.

count (number)

The number of characters in the generated alt text (result).

brand (string | null)

The brand value provided in the request, or null if not set.

style (string)

The writing style used for generating the alt text.

keywords (string[] | null)

The list of keywords used to guide the generation, or null if none were provided.

result (string | null)

The generated alt text. Will be null if the request failed or is still processing.

status (string)

The status of the generation request. Possible values include: "pending", "generated", "failed"

Example: Response body
    	
{
  "id": "67ec1576cff7b406dd905ce3",
  "imageUrl": "https://example.com/image.jpg",
  "lang": "en",
  "style": "neutral",
  "count": 97,
  "brand": "Acme Co.",
  "keywords": ["eco-friendly", "minimalist"],
  "result": "An eco-friendly, minimalist water bottle by Acme Co.,
placed on a white table with soft natural light.",
  "status": "generated",
  "createdAt": "2025-03-31T12:00:00.000Z",
  "updatedAt": "2025-03-31T12:00:02.000Z"
}
    	
    

Supported languages

The AltTextLab API supports alt text generation in over 130 languages. Specify the desired language using the lang field in your request body.

Below is the full list of supported languages and their corresponding codes:

Supported languages
    	
Afrikaans — `af`  
Albanian — `sq`  
Amharic — `am`  
Arabic — `ar`  
Armenian — `hy`  
Assamese — `as`  
Aymara — `ay`  
Azerbaijani — `az`  
Bambara — `bm`  
Basque — `eu`  
Belarusian — `be`  
Bengali — `bn`  
Bhojpuri — `bho`  
Bosnian — `bs`  
Bulgarian — `bg`  
Catalan — `ca`  
Cebuano — `ceb`  
Chinese (Simplified) — `zh-cn`  
Chinese (Traditional) — `zh-tw`  
Corsican — `co`  
Croatian — `hr`  
Czech — `cs`  
Danish — `da`  
Dhivehi — `dv`  
Dogri — `doi`  
Dutch — `nl`  
English — `en`  
Esperanto — `eo`  
Estonian — `et`  
Ewe — `ee`  
Filipino (Tagalog) — `fil`  
Finnish — `fi`  
French — `fr`  
Frisian — `fy`  
Galician — `gl`  
Georgian — `ka`  
German — `de`  
Greek — `el`  
Guarani — `gn`  
Gujarati — `gu`  
Haitian Creole — `ht`  
Hausa — `ha`  
Hawaiian — `haw`  
Hebrew — `he`  
Hindi — `hi`  
Hmong — `hmn`  
Hungarian — `hu`  
Icelandic — `is`  
Igbo — `ig`  
Ilocano — `ilo`  
Indonesian — `id`  
Irish — `ga`  
Italian — `it`  
Japanese — `ja`  
Javanese — `jv`  
Kannada — `kn`  
Kazakh — `kk`  
Khmer — `km`  
Kinyarwanda — `rw`  
Konkani — `gom`  
Korean — `ko`  
Krio — `kri`  
Kurdish — `ku`  
Kurdish (Sorani) — `ckb`  
Kyrgyz — `ky`  
Lao — `lo`  
Latin — `la`  
Latvian — `lv`  
Lingala — `ln`  
Lithuanian — `lt`  
Luganda — `lg`  
Luxembourgish — `lb`  
Macedonian — `mk`  
Maithili — `mai`  
Malagasy — `mg`  
Malay — `ms`  
Malayalam — `ml`  
Maltese — `mt`  
Maori — `mi`  
Marathi — `mr`  
Meiteilon (Manipuri) — `mni-mtei`  
Mizo — `lus`  
Mongolian — `mn`  
Myanmar (Burmese) — `my`  
Nepali — `ne`  
Norwegian — `no`  
Nyanja (Chichewa) — `ny`  
Odia (Oriya) — `or`  
Oromo — `om`  
Pashto — `ps`  
Persian — `fa`  
Polish — `pl`  
Portuguese — `pt`  
Punjabi — `pa`  
Quechua — `qu`  
Romanian — `ro`  
Russian — `ru`  
Samoan — `sm`  
Sanskrit — `sa`  
Scots Gaelic — `gd`  
Sepedi — `nso`  
Serbian — `sr`  
Sesotho — `st`  
Shona — `sn`  
Sindhi — `sd`  
Sinhala (Sinhalese) — `si`  
Slovak — `sk`  
Slovenian — `sl`  
Somali — `so`  
Spanish — `es`  
Sundanese — `su`  
Swahili — `sw`  
Swedish — `sv`  
Tagalog (Filipino) — `tl`  
Tajik — `tg`  
Tamil — `ta`  
Tatar — `tt`  
Telugu — `te`  
Thai — `th`  
Tigrinya — `ti`  
Tsonga — `ts`  
Turkish — `tr`  
Turkmen — `tk`  
Twi (Akan) — `ak`  
Ukrainian — `uk`  
Urdu — `ur`  
Uyghur — `ug`  
Uzbek — `uz`  
Vietnamese — `vi`  
Welsh — `cy`  
Xhosa — `xh`  
Yiddish — `yi`  
Yoruba — `yo`  
Zulu — `zu`