Documentation

API

Server-side image generation requests, response format, and error codes.

Request

Call the API from your server only. Never expose API keys in client JavaScript.

generate.sh
curl -X POST https://ogcover.io/api/generate \
  -H "Authorization: Bearer $OGCOVER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "YOUR_TEMPLATE_ID",
    "variables": {
      "title": "New article title"
    }
  }' \
  --output og-image.jpg

Response

Format

Successful responses currently return JPEG: Content-Type image/jpeg.

CodeMeaning
200JPEG image with Content-Type image/jpeg
400Invalid JSON or parameters
401Missing Authorization Bearer
403Invalid key or feature unavailable on this plan
402Generation quota exceeded. WordPress plugin checks this code.
404Template not found or belongs to another user
429Too many requests: 3 requests per second per API key