AltGenAI - AI Alt Text Generator for Images | Free Trial

Alttextgenie API Documentation

Generate SEO-optimized alt text for images in multiple languages using AI. Our API provides fast, reliable, and scalable image description generation with support for 130+ languages.

Base URL: https://alttextgenie.com/api/v1
All API requests must be made over HTTPS. HTTP requests will be redirected.

Authentication

All API requests require authentication using an API key. Include your API key in the request headers.

Required X-API-Key: YOUR_API_KEY

Include this header in every request. API keys can be generated from your dashboard.

curl
curl -H "X-API-Key: YOUR_API_KEY" \ "https://alttextgenie.com/api/v1/account.php"

API Keys

Each user can generate multiple API keys for different applications. Keys are stored as SHA-256 hashes for security.

Manage API Keys

Create, view, and revoke API keys from your dashboard

Important: API keys provide full access to your account. Keep them secure and never expose them in client-side code.

Dashboard Location: https://alttextgenie.com/dashboard#settings/api

From the dashboard you can:

  • Generate new API keys
  • View existing keys (only shown once at creation)
  • Deactivate/revoke keys
  • Monitor API usage per key

Rate Limits & Credits

API usage is measured in credits. Each language generated costs 1 credit.

Credit System

How credits are consumed

Action Credits Description
Single language alt text 1 credit Generate alt text in one language
Multiple languages n credits Each additional language costs 1 credit
Account endpoint 0 credits Checking account info is free
Languages endpoint 0 credits Getting available languages is free

Account Information

Get information about your account, including credit balance and usage statistics.

GET https://alttextgenie.com/api/v1/account.php
curl
curl -H "X-API-Key: YOUR_API_KEY" \ "https://alttextgenie.com/api/v1/account.php"

Response

json
{ "success": true, "data": { "user": { "id": 123, "name": "John Doe", "email": "john@example.com", "company": "Example Corp", "credits": 1500, "processed_images": 42, "subscription_status": "active", "current_plan_key": "pro" }, "credits_remaining": 1500 }, "timestamp": "2025-12-27 18:06:54" }

Available Languages

Get a list of all supported languages for alt text generation.

GET https://alttextgenie.com/api/v1/languages.php
curl
curl -H "X-API-Key: YOUR_API_KEY" \ "https://alttextgenie.com/api/v1/languages.php"

Response

json
{ "success": true, "data": { "languages": [ {"code": "en", "name": "English", "native_name": "English", "flag_emoji": "🇺🇸"}, {"code": "es", "name": "Spanish", "native_name": "Español", "flag_emoji": "🇪🇸"}, // ... 130+ languages total ], "default": "en", "count": 130 }, "timestamp": "2025-12-27 18:06:54" }

Generate Alt Text

The main endpoint for generating alt text from images. Supports both file uploads and image URLs.

POST https://alttextgenie.com/api/v1/generate.php

Parameters

Parameter Type Required Description Default
image_url string Optional* URL to the image (required if no file upload) -
image (file) file Optional* Image file upload (required if no URL) -
languages array/string Optional Array of language codes or comma-separated string ["en"]
style_id integer Optional Style of alt text (1-5) 2
keywords string Optional Keywords to include in alt text (max 255 chars) ""

* Either image_url or image file upload is required.

Request Examples

curl (JSON)
curl -X POST \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": "https://example.com/image.jpg", "languages": ["en", "es", "fr"], "style_id": 2, "keywords": "photography camera" }' \ "https://alttextgenie.com/api/v1/generate.php"
curl (File Upload)
curl -X POST \ -H "X-API-Key: YOUR_API_KEY" \ -F "image=@/path/to/image.jpg" \ -F "languages=en,es" \ -F "style_id=2" \ "https://alttextgenie.com/api/v1/generate.php"

Response

json
{ "success": true, "data": { "alt_texts": { "en": "person in beanie holds Canon camera for photography, outdoor field", "es": "persona con gorro sostiene cámara Canon para fotografía, campo al aire libre", "fr": "personne en bonnet tient un appareil photo Canon pour la photographie, champ extérieur" }, "image_id": "1766858814186849" }, "timestamp": "2025-12-27 18:06:54" }

Supported Languages

Alttextgenie supports alt text generation in 138 languages. Each language costs 1 credit per image.

Code Language Native Name Flag Status
af Afrikaans Afrikaans 🇿🇦 ✓ Available
sq Albanian Shqip 🇦🇱 ✓ Available
am Amharic አማርኛ 🇪🇹 ✓ Available
ar Arabic العربية 🇸🇦 ✓ Available
hy Armenian Հայերեն 🇦🇲 ✓ Available
as Assamese অসমীয়া 🇮🇳 ✓ Available
ay Aymara Aymar aru 🇧🇴 ✓ Available
az Azerbaijani Azərbaycanca 🇦🇿 ✓ Available
bm Bambara Bamanankan 🇲🇱 ✓ Available
eu Basque Euskara 🇪🇸 ✓ Available
be Belarusian Беларуская 🇧🇾 ✓ Available
bn Bengali বাংলা 🇧🇩 ✓ Available
bho Bhojpuri भोजपुरी 🇮🇳 ✓ Available
bs Bosnian Bosanski 🇧🇦 ✓ Available
br Breton Brezhoneg 🇫🇷 ✓ Available
bg Bulgarian Български 🇧🇬 ✓ Available
my Burmese မြန်မာဘာသာ 🇲🇲 ✓ Available
ca Catalan Català 🇪🇸 ✓ Available
ceb Cebuano Cebuano 🇵🇭 ✓ Available
ny Chichewa Chichewa 🇲🇼 ✓ Available
zh Chinese 中文 🇨🇳 ✓ Available
co Corsican Corsu 🇫🇷 ✓ Available
hr Croatian Hrvatski 🇭🇷 ✓ Available
cs Czech Čeština 🇨🇿 ✓ Available
da Danish Dansk 🇩🇰 ✓ Available
dv Dhivehi ދިވެހި 🇲🇻 ✓ Available
doi Dogri डोगरी 🇮🇳 ✓ Available
nl Dutch Nederlands 🇳🇱 ✓ Available
en English English 🇺🇸 ✓ Available
eo Esperanto Esperanto 🏳️ ✓ Available
et Estonian Eesti 🇪🇪 ✓ Available
ee Ewe Eʋegbe 🇬🇭 ✓ Available
fo Faroese Føroyskt 🇫🇴 ✓ Available
tl Filipino Filipino 🇵🇭 ✓ Available
fi Finnish Suomi 🇫🇮 ✓ Available
fr French Français 🇫🇷 ✓ Available
fy Frisian Frysk 🇳🇱 ✓ Available
gl Galician Galego 🇪🇸 ✓ Available
ka Georgian ქართული 🇬🇪 ✓ Available
de German Deutsch 🇩🇪 ✓ Available
el Greek Ελληνικά 🇬🇷 ✓ Available
gn Guarani Avañeʼẽ 🇵🇾 ✓ Available
gu Gujarati ગુજરાતી 🇮🇳 ✓ Available
ht Haitian Creole Kreyòl Ayisyen 🇭🇹 ✓ Available
ha Hausa Hausa 🇳🇬 ✓ Available
haw Hawaiian ʻŌlelo Hawaiʻi 🇺🇸 ✓ Available
he Hebrew עברית 🇮🇱 ✓ Available
iw Hebrew (old code) עברית 🇮🇱 ✓ Available
hi Hindi हिन्दी 🇮🇳 ✓ Available
hmn Hmong Hmong 🇨🇳 ✓ Available
hu Hungarian Magyar 🇭🇺 ✓ Available
is Icelandic Íslenska 🇮🇸 ✓ Available
ig Igbo Igbo 🇳🇬 ✓ Available
ilo Ilocano Ilokano 🇵🇭 ✓ Available
id Indonesian Bahasa Indonesia 🇮🇩 ✓ Available
ga Irish Gaeilge 🇮🇪 ✓ Available
it Italian Italiano 🇮🇹 ✓ Available
ja Japanese 日本語 🇯🇵 ✓ Available
jv Javanese Basa Jawa 🇮🇩 ✓ Available
kl Kalaallisut Kalaallisut 🇬🇱 ✓ Available
kn Kannada ಕನ್ನಡ 🇮🇳 ✓ Available
kk Kazakh Қазақша 🇰🇿 ✓ Available
km Khmer ភាសាខ្មែរ 🇰🇭 ✓ Available
rw Kinyarwanda Kinyarwanda 🇷🇼 ✓ Available
ko Korean 한국어 🇰🇷 ✓ Available
ku Kurdish Kurdî 🇮🇶 ✓ Available
ky Kyrgyz Кыргызча 🇰🇬 ✓ Available
lo Lao ລາວ 🇱🇦 ✓ Available
la Latin Latina 🏛️ ✓ Available
lv Latvian Latviešu 🇱🇻 ✓ Available
ln Lingala Lingála 🇨🇩 ✓ Available
lt Lithuanian Lietuvių 🇱🇹 ✓ Available
lg Luganda Luganda 🇺🇬 ✓ Available
lb Luxembourgish Lëtzebuergesch 🇱🇺 ✓ Available
mk Macedonian Македонски 🇲🇰 ✓ Available
mai Maithili मैथिली 🇮🇳 ✓ Available
mg Malagasy Malagasy 🇲🇬 ✓ Available
ms Malay Bahasa Melayu 🇲🇾 ✓ Available
ml Malayalam മലയാളം 🇮🇳 ✓ Available
mt Maltese Malti 🇲🇹 ✓ Available
mni Manipuri মৈতৈলোন্ 🇮🇳 ✓ Available
mi Maori Māori 🇳🇿 ✓ Available
mr Marathi मराठी 🇮🇳 ✓ Available
lus Mizo Mizo ṭawng 🇮🇳 ✓ Available
mn Mongolian Монгол 🇲🇳 ✓ Available
ne Nepali नेपाली 🇳🇵 ✓ Available
no Norwegian Norsk 🇳🇴 ✓ Available
or Odia ଓଡ଼ିଆ 🇮🇳 ✓ Available
om Oromo Afaan Oromoo 🇪🇹 ✓ Available
ps Pashto پښتو 🇦🇫 ✓ Available
fa Persian فارسی 🇮🇷 ✓ Available
pl Polish Polski 🇵🇱 ✓ Available
pt Portuguese Português 🇵🇹 ✓ Available
pa Punjabi ਪੰਜਾਬੀ 🇮🇳 ✓ Available
qu Quechua Runasimi 🇵🇪 ✓ Available
ro Romanian Română 🇷🇴 ✓ Available
ru Russian Русский 🇷🇺 ✓ Available
sm Samoan Gagana Sāmoa 🇼🇸 ✓ Available
sa Sanskrit संस्कृतम् 🇮🇳 ✓ Available
gd Scottish Gaelic Gàidhlig 🏴󠁧󠁢󠁳󠁣󠁴󠁿 ✓ Available
nso Sepedi Sepedi 🇿🇦 ✓ Available
sr Serbian Српски 🇷🇸 ✓ Available
st Sesotho Sesotho 🇱🇸 ✓ Available
sn Shona ChiShona 🇿🇼 ✓ Available
sd Sindhi سنڌي 🇵🇰 ✓ Available
si Sinhala සිංහල 🇱🇰 ✓ Available
sk Slovak Slovenčina 🇸🇰 ✓ Available
sl Slovenian Slovenščina 🇸🇮 ✓ Available
so Somali Soomaali 🇸🇴 ✓ Available
es Spanish Español 🇪🇸 ✓ Available
su Sundanese Basa Sunda 🇮🇩 ✓ Available
sw Swahili Kiswahili 🇹🇿 ✓ Available
sv Swedish Svenska 🇸🇪 ✓ Available
tg Tajik Тоҷикӣ 🇹🇯 ✓ Available
ta Tamil தமிழ் 🇮🇳 ✓ Available
tt Tatar Татарча 🇷🇺 ✓ Available
te Telugu తెలుగు 🇮🇳 ✓ Available
th Thai ไทย 🇹🇭 ✓ Available
bo Tibetan བོད་སྐད་ 🇨🇳 ✓ Available
ti Tigrinya ትግርኛ 🇪🇷 ✓ Available
to Tongan Lea faka-Tonga 🇹🇴 ✓ Available
ts Tsonga Xitsonga 🇿🇦 ✓ Available
tn Tswana Setswana 🇧🇼 ✓ Available
tr Turkish Türkçe 🇹🇷 ✓ Available
tk Turkmen Türkmençe 🇹🇲 ✓ Available
uk Ukrainian Українська 🇺🇦 ✓ Available
ur Urdu اردو 🇵🇰 ✓ Available
ug Uyghur ئۇيغۇرچە 🇨🇳 ✓ Available
uz Uzbek Oʻzbekcha 🇺🇿 ✓ Available
vi Vietnamese Tiếng Việt 🇻🇳 ✓ Available
wa Walloon Walon 🇧🇪 ✓ Available
cy Welsh Cymraeg 🏴󠁧󠁢󠁷󠁬󠁳󠁿 ✓ Available
wo Wolof Wolof 🇸🇳 ✓ Available
xh Xhosa isiXhosa 🇿🇦 ✓ Available
yi Yiddish ייִדיש 🇮🇱 ✓ Available
yo Yoruba Yorùbá 🇳🇬 ✓ Available
zza Zaza Zazaki 🇹🇷 ✓ Available
zu Zulu isiZulu 🇿🇦 ✓ Available
Showing 138 active languages
Note: All languages cost 1 credit each. Example: Generating alt text in 5 languages = 5 credits.

Style Options

Choose the writing style that best fits your needs. Different styles produce alt text of varying length and detail.

ID Style Description Best For
1 Professional Factual and professional tone for business content Business websites, e-commerce
2 Recommended Balanced and descriptive (default) General purpose, blogs
3 Shorter Concise, focus on essential details Mobile, social media
4 Comprehensive Highly detailed and thorough descriptions Art galleries, photography
5 Briefest Minimal, one short sentence Icons, logos, thumbnails
Tip: Style 2 (Recommended) is the default and works well for most use cases. Use Style 4 for detailed descriptions and Style 5 for minimal alt text.

Code Examples

Python

python
import requests api_key = "YOUR_API_KEY" url = "https://alttextgenie.com/api/v1/generate.php" headers = { "X-API-Key": api_key, "Content-Type": "application/json" } data = { "image_url": "https://example.com/image.jpg", "languages": ["en", "es"], "style_id": 2 } response = requests.post(url, json=data, headers=headers) result = response.json() if result["success"]: for lang, alt_text in result["data"]["alt_texts"].items(): print(f"{lang}: {alt_text}") else: print(f"Error: {result['error']}")

JavaScript (Node.js)

javascript
const axios = require('axios'); async function generateAltText() { try { const response = await axios.post( 'https://alttextgenie.com/api/v1/generate.php', { image_url: 'https://example.com/image.jpg', languages: ['en', 'fr'], style_id: 2 }, { headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' } } ); if (response.data.success) { console.log('Alt texts:', response.data.data.alt_texts); } else { console.error('Error:', response.data.error); } } catch (error) { console.error('Request failed:', error.message); } } generateAltText();

PHP

php
$api_key = 'YOUR_API_KEY'; $api_url = 'https://alttextgenie.com/api/v1/generate.php'; $data = [ 'image_url' => 'https://example.com/image.jpg', 'languages' => ['en', 'de'], 'style_id' => 2, 'keywords' => 'product photography' ]; $ch = curl_init($api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-API-Key: ' . $api_key, 'Content-Type: application/json' ]); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); if ($result['success']) { foreach ($result['data']['alt_texts'] as $lang => $alt_text) { echo "$lang: $alt_text\n"; } } else { echo "Error: " . $result['error'] . "\n"; }

Error Handling

The API returns standard HTTP status codes and detailed error messages in the response.

Status Code Meaning Possible Reasons
200 Success Request completed successfully
400 Bad Request Invalid parameters, missing required fields
401 Unauthorized Missing or invalid API key
402 Payment Required Insufficient credits
405 Method Not Allowed Using GET instead of POST or vice versa
500 Internal Server Error Server-side error, AI model failure

Error Response Example

json
{ "success": false, "error": "Insufficient credits. Needed: 3, Available: 1", "timestamp": "2025-12-27 18:06:54" }
Copied to clipboard!