Skip to content

Check Usage

Monitor your API usage and quota.

Endpoint

GET /api/user/usage

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Response

Success (200)

json
{
  "plan": "pro",
  "quota": 5000,
  "used": 1234,
  "remaining": 3766,
  "percent_used": 24.68,
  "reset_date": "2024-02-01T00:00:00.000Z",
  "last_reset": "2024-01-01T00:00:00.000Z"
}

Fields

FieldTypeDescription
planstringCurrent plan: free, pro, business, past_due, or canceled
quotaintegerMonthly image generation limit
usedintegerImages generated this month
remainingintegerImages remaining this month
percent_usedfloatUsage percentage (0-100)
reset_datestringNext quota reset date (ISO 8601)
last_resetstringLast quota reset date (ISO 8601)

Example

bash
curl https://ogimageapi.io/api/user/usage \
  -H "X-API-Key: og_your_api_key"

Response:

json
{
  "plan": "pro",
  "quota": 5000,
  "used": 847,
  "remaining": 4153,
  "percent_used": 16.94,
  "reset_date": "2024-02-01T00:00:00.000Z",
  "last_reset": "2024-01-01T00:00:00.000Z"
}

Usage Tips

Monitoring Usage

Check your usage regularly to avoid hitting limits:

javascript
async function checkUsage() {
  const response = await fetch('https://ogimageapi.io/api/user/usage', {
    headers: { 'X-API-Key': process.env.OG_IMAGE_API_KEY }
  });
  
  const data = await response.json();
  
  if (data.percent_used > 80) {
    console.warn(`Warning: ${data.percent_used}% of quota used`);
  }
  
  return data;
}

Quota Alerts

We automatically send email alerts at:

  • 80% of quota used
  • 95% of quota used

What Happens at 100%?

When you reach your quota limit:

  • API returns 429 QUOTA_EXCEEDED
  • Usage resets on the 1st of each month
  • Consider upgrading for higher limits

Error Responses

StatusCodeDescription
401MISSING_API_KEYNo API key provided
401INVALID_API_KEYInvalid API key
500FETCH_FAILEDServer error

Generate stunning Open Graph images programmatically.