PostGrad
API Reference

Get API usage for current period

View as Markdown

Returns the authenticated key's usage for the current billing period in the canonical `usage` envelope block. `data` is `null` — every consumer should read `response.usage` for tier + quota information.

GET
/usage

Authorization

AuthorizationBearer <token>

API key passed as Bearer token. Keys use the pg_live_ prefix for production and pg_test_ for test environments.

In: header

Response Body

application/json

application/json

application/json

curl -X GET "https://postgrad.io/api/v1/usage"
{
  "data": null,
  "pagination": null,
  "usage": {
    "queries_used": 42,
    "queries_limit": 1000,
    "queries_remaining": 958,
    "period_start": "2026-05-01T00:00:00Z",
    "period_end": "2026-06-01T00:00:00Z",
    "tier": "starter"
  },
  "context": null,
  "error": null
}
{
  "data": null,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}
{
  "data": null,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Try again later."
  }
}