API Reference
Get API usage for current period
View as MarkdownReturns 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.
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."
}
}Get knowledge base statistics
Returns high-level statistics about the knowledge base including total entries, number of categories, and last updated timestamp. This is a public endpoint that does not require authentication. Responses are cached for 5 minutes.
MCP Integration
Connect your AI agent to PostGrad via the Model Context Protocol.