Appearance
Rate Limits
Understand usage quotas and rate limiting.
Monthly Quotas
Each plan includes a monthly image generation quota:
| Plan | Monthly Quota | Price | Overage |
|---|---|---|---|
| Free | 25 images | $0/mo | — |
| Starter | 500 images | $9/mo | $0.02/ea |
| Pro | 2,000 images | $19/mo | $0.01/ea |
| Agency | 10,000 images | $49/mo | $0.01/ea |
| Publishing | 50,000 images | $99/mo | $0.01/ea |
How Quotas Work
- Each successful image generation counts as 1 toward your quota
- Failed requests (4xx/5xx errors) do not count
- Quota resets on the 1st of each month at 00:00 UTC
- Unused quota does not roll over
Quota Exceeded
When you exceed your monthly quota:
- API returns
429 Too Many Requests - Error code:
QUOTA_EXCEEDED - Images cannot be generated until quota resets
Example error response:
json
{
"error": true,
"message": "Monthly quota exceeded. Limit: 500 images.",
"code": "QUOTA_EXCEEDED"
}Monitoring Usage
Check your current usage:
bash
curl https://ogimageapi.io/api/user/usage \
-H "X-API-Key: og_your_api_key"Response:
json
{
"plan": "pro",
"quota": 500,
"used": 425,
"remaining": 75,
"percent_used": 85,
"reset_date": "2024-02-01T00:00:00.000Z"
}Quota Alerts
We automatically send email alerts at:
| Usage | Alert |
|---|---|
| 80% | Warning email sent |
| 95% | Critical warning sent |
| 100% | Quota exceeded notification |
Request Rate Limits
In addition to monthly quotas, there are per-second rate limits to ensure service stability:
| Plan | Requests/Second |
|---|---|
| Free | 1 req/s |
| Starter | 5 req/s |
| Pro | 10 req/s |
| Agency | 25 req/s |
| Publishing | 50 req/s |
If you exceed the rate limit, you'll receive a 429 response. Wait briefly and retry.
Best Practices
Cache Generated Images
Don't regenerate the same image repeatedly:
javascript
// Good: Cache with a CDN or locally
const cachedImage = await cache.get(`og-${postId}`);
if (cachedImage) return cachedImage;
const image = await generateOGImage(post);
await cache.set(`og-${postId}`, image);
return image;Generate at Build Time
For static content, generate images during build rather than on-demand:
javascript
// build-og-images.js
for (const post of posts) {
const image = await generateOGImage(post);
saveToPublicFolder(post.slug, image);
}Monitor Usage Programmatically
javascript
async function checkQuota() {
const usage = await client.getUsage();
if (usage.percent_used > 90) {
notifyAdmin('OG Image quota nearly exhausted');
}
return usage.remaining > 0;
}Need More?
If you consistently need more than 50,000 images/month, contact us for custom enterprise pricing with volume discounts.