Skip to main content
POST
/
v1
/
generate-alt-text-api
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

x-api-key
string
header
required

Body

application/json
image_url
string<uri>
required

Publicly accessible URL of the image to generate alt text for. Either image_url or image_file must be provided.

user_id
string<email>
required

Unique identifier (email) for the user requesting the alt text

image_file
string<data-uri>

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.

Example:

"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABmX/9k="

blog_title
string

Blog or article title to provide additional context

seo_keywords
string

Comma-separated keywords for SEO optimization

language_code
string

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.

Response

Successful alt text generation

altText
string

The generated alt text

CreditsAvailable
integer

Remaining credits for the user after this request

plan_type
string

The user's subscription plan