Quickstart
1. Get an API key
Section titled “1. Get an API key”Sign up for a free account (100 images/month, no card required). Your dashboard shows your API key once — copy it somewhere safe. You can rotate it any time from the dashboard if it leaks.
2. Call the API
Section titled “2. Call the API”POST /v1/alttext with an image URL and your key as a Bearer token:
curl https://api.altpilot.app/v1/alttext \ -H "Authorization: Bearer $ALTPILOT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/240px-Example.svg.png" }'{ "alt": "A blue rounded rectangle icon with the word \"Example\" in white text", "caption": "A simple placeholder graphic labeled Example", "language": "en", "cached": false}3. In your language
Section titled “3. In your language”JavaScript / Node
Section titled “JavaScript / Node”const res = await fetch("https://api.altpilot.app/v1/alttext", { method: "POST", headers: { Authorization: `Bearer ${process.env.ALTPILOT_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ image_url: imageUrl }),});const { alt, caption } = await res.json();$response = wp_remote_post('https://api.altpilot.app/v1/alttext', [ 'headers' => [ 'Authorization' => 'Bearer ' . $apiKey, 'Content-Type' => 'application/json', ], 'body' => wp_json_encode(['image_url' => $imageUrl]),]);$data = json_decode(wp_remote_retrieve_body($response), true);// $data['alt'], $data['caption'](Using plain PHP/cURL instead of WordPress? Any HTTP client works — this
is exactly what the WordPress plugin itself does, see
wordpress-plugin/altpilot/altpilot.php.)
Python
Section titled “Python”import os, requests
res = requests.post( "https://api.altpilot.app/v1/alttext", headers={"Authorization": f"Bearer {os.environ['ALTPILOT_API_KEY']}"}, json={"image_url": image_url},)data = res.json()# data["alt"], data["caption"]4. Next steps
Section titled “4. Next steps”- Full request/response shape, every status code: API Reference.
- Check your remaining quota:
GET /v1/usage. - Hit a non-200 response? See Troubleshooting.