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.jpgResponse
Format
Successful responses currently return JPEG: Content-Type image/jpeg.
| Code | Meaning |
|---|---|
| 200 | JPEG image with Content-Type image/jpeg |
| 400 | Invalid JSON or parameters |
| 401 | Missing Authorization Bearer |
| 403 | Invalid key or feature unavailable on this plan |
| 402 | Generation quota exceeded. WordPress plugin checks this code. |
| 404 | Template not found or belongs to another user |
| 429 | Too many requests: 3 requests per second per API key |