Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pixcraft.es/llms.txt

Use this file to discover all available pages before exploring further.

Get Usage

GET /api/v1/usage
Returns current usage statistics for the authenticated API key, including a daily breakdown for the current billing period.

Example request

curl https://www.pixcraft.es/api/v1/usage \
  -H "Authorization: Bearer px_live_your_key"

Example response

{
  "api_key": "px_...abc123",
  "plan": "business",
  "period": "2025-03",
  "calls_used": 243,
  "calls_limit": 2000,
  "calls_remaining": 1757,
  "reset_date": "2025-04-01",
  "daily_breakdown": [
    { "date": "2025-03-01", "calls": 12 },
    { "date": "2025-03-02", "calls": 8 },
    { "date": "2025-03-03", "calls": 23 }
  ]
}

Response fields

FieldTypeDescription
api_keystringMasked version of your API key
planstringYour plan name (starter, business, enterprise)
periodstringCurrent billing period (YYYY-MM)
calls_usednumberAPI calls consumed this period
calls_limitnumber or “unlimited”Your plan’s monthly limit
calls_remainingnumber or “unlimited”Calls left this period
reset_datestringWhen the counter resets (YYYY-MM-DD)
daily_breakdownarrayPer-day call counts for the current period

Building a usage dashboard

Use this endpoint to show your users or team how many API calls remain. For example:
const res = await fetch('https://www.pixcraft.es/api/v1/usage', {
  headers: { 'Authorization': 'Bearer px_live_your_key' },
});
const usage = await res.json();

const percent = (usage.calls_used / usage.calls_limit) * 100;
console.log(`${percent.toFixed(1)}% of monthly limit used`);

if (percent > 80) {
  console.warn('Warning: approaching monthly API limit');
}