Base URL

txt
https://api.altextapi.com

All requests must include your API key in the X-API-Key header.

Authentication

POST/api/validate-key

Validate your API key and get account information.

Request Body

txt
{
  "api_key": "alt_YOUR_API_KEY"
}

Response

txt
{
  "valid": true,
  "plan": "free",
  "credits_total": 50,
  "credits_used": 12,
  "credits_remaining": 38
}

Generate Alt Text

POST/api/alt-text🔑 API Key

Generate alt text for a single image URL.

Request Body

txt
{
  "image_url": "https://example.com/photo.jpg",
  "keywords": ["product", "ecommerce"],
  "language": "en"
}

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | image_url | string | Yes | Public HTTPS URL of the image | | keywords | string[] | No | Up to 10 context keywords | | language | string | No | ISO 639-1 code (default: en) |

Response

txt
{
  "alt_text": "A modern ergonomic office chair with black mesh back and adjustable armrests against a white background.",
  "length": 118,
  "language": "en",
  "cached": false
}

Rate Limits

60 requests per minute per IP. Auth endpoints: 5 requests per minute.

Check Usage

GET/api/usage🔑 API Key

Get current plan, credit usage, and account status.

Response

txt
{
  "plan": "free",
  "credits": {
    "total": 50,
    "used": 12,
    "remaining": 38
  },
  "api_calls_today": 5
}

Error Codes

| Status | Description | |--------|-------------| | 400 | Missing or malformed request body | | 401 | Invalid or missing API key | | 429 | Rate limit exceeded or quota reached | | 500 | Server error — try again later | | 502 | AI provider error |

Always check credits

Use GET /api/usage before bulk operations to avoid hitting your monthly limit mid-batch.