Prerequisites
- An AltText AI account (sign up here)
- An API key from your dashboard
Step 1: Get Your API Key
- Sign up at altextapi.com/signup
- Go to your dashboard
- Copy your API key — it starts with
alt_
Keep your key secret
Your API key grants access to your account. Never commit it to version control or expose it in client-side code. Use environment variables.
Step 2: Make Your First API Call
txt
curl -X POST https://api.altextapi.com/v1/alt-text \
-H "Content-Type: application/json" \
-H "X-API-Key: alt_YOUR_API_KEY" \
-d '{
"image_url": "https://example.com/photo.jpg"
}'
Response:
txt
{
"alt_text": "A red fox stands alert on sandy dunes with dry grass and a blurred ocean horizon behind it.",
"credits_remaining": 47,
"wcag_compliant": true,
"character_count": 112,
"processing_time_ms": 1450
}
Step 3: Choose Your Integration
WordPress Plugin
The simplest way to add alt text to your WordPress site.
- Go to Plugins → Add New
- Search for "AltText AI"
- Click Install → Activate
- Go to Settings → AltText AI and paste your API key
- Upload an image — alt text is generated automatically!
JavaScript Widget
Add one script tag to any website:
txt
<script
src="https://cdn.altextapi.com/widget.js"
data-api-key="alt_YOUR_API_KEY"
data-auto="true"
></script>
The widget automatically scans your page for images with missing alt text and fills them in.
REST API
Full programmatic access. See the API Reference for complete documentation.
Step 4: Verify It Works
Visit any page on your site and inspect an image:
txt
<img
src="photo.jpg"
alt="A red fox stands alert on sandy dunes with dry grass and a blurred ocean horizon behind it."
/>
That's it! Your images now have WCAG-compliant, SEO-optimized alt text.
Next Steps
- API Reference — Explore all endpoints
- WordPress Plugin — Advanced plugin configuration
- JavaScript Widget — Widget customization options