Skip to content

Quickstart

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.

POST /v1/alttext with an image URL and your key as a Bearer token:

Terminal window
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
}
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.)

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"]
  • Full request/response shape, every status code: API Reference.
  • Check your remaining quota: GET /v1/usage.
  • Hit a non-200 response? See Troubleshooting.