curl --request POST \
--url https://api.altmagic.pro/v1/generate-alt-text-api \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"image_url": "https://example.com/image.jpg",
"user_id": "[email protected]",
"blog_title": "Healthy Eating Guide",
"seo_keywords": "healthy, food, nutrition, apples",
"language_code": "en"
}
'{
"altText": "<string>",
"CreditsAvailable": 123,
"plan_type": "<string>"
}Generate Alt Text
Generate descriptive alt text for images using AI with automatic fallback from Gemini to OpenAI
curl --request POST \
--url https://api.altmagic.pro/v1/generate-alt-text-api \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"image_url": "https://example.com/image.jpg",
"user_id": "[email protected]",
"blog_title": "Healthy Eating Guide",
"seo_keywords": "healthy, food, nutrition, apples",
"language_code": "en"
}
'{
"altText": "<string>",
"CreditsAvailable": 123,
"plan_type": "<string>"
}Authorizations
Body
- Option 1
- Option 2
Publicly accessible URL of the image to generate alt text for. Either image_url or image_file must be provided.
Unique identifier (email) for the user requesting the alt text
Image file in data URI format with base64 encoded image data. Format: data:image/[type];base64,[base64-data]. Either image_url or image_file must be provided.
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABmX/9k="
Blog or article title to provide additional context
Comma-separated keywords for SEO optimization
Language code (e.g., 'en', 'fr', 'es') for generated alt text. If not provided, defaults to English ('en'). See Language Support page for complete list of supported languages.