Overview
Generate alt text for a single image using the ATG endpoint. This endpoint provides the same functionality as /generate but uses a different route for compatibility with existing integrations.
Request Body
The URL of the image to generate alt text for
The length of alt text to generate. Options: short, long, seo
Example Request
cURL
curl -X POST https://api.gistmag.co.uk/atg/generate \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/image.jpg",
"api_key": "your_api_key_here",
"mode": "short"
}'
Python
import requests
url = "https://api.gistmag.co.uk/atg/generate"
payload = {
"image_url": "https://example.com/image.jpg",
"api_key": "your_api_key_here",
"mode": "short"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.json()}")
# If successful
if response.status_code == 200:
data = response.json()
print(f"Alt Text: {data.get('alt_text')}")
Response
The response format is identical to the /generate endpoint.
The generated alt text description
Confidence score (0-1) of the generated alt text
Number of credits consumed for this request
Example Response
{
"alt_text": "A beautiful sunset over the ocean with orange and pink hues",
"confidence": 0.95,
"credits_used": 1
}
This endpoint is maintained for backward compatibility. New integrations should use /generate.