Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt

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

Returns the current billing cycle credit summary for your org. Requires the control:read scope.

Get usage

GET https://api.usehasp.com/v1/usage
Authorization: Bearer wa_live_...

Response

{
  "success": true,
  "data": {
    "period": {
      "start": "2026-05-01T00:00:00+00:00",
      "end": null
    },
    "credits": {
      "allotment": 100000,
      "used": 37420,
      "remaining": 62580,
      "overage_purchased": 0,
      "overage_consumed": 0
    },
    "requests": {
      "total": 841
    }
  }
}

Fields

FieldDescription
period.startStart of the current billing cycle (ISO 8601).
period.endEnd of the current billing cycle, or null if open-ended.
credits.allotmentTotal credits available this cycle (base plan + any overages purchased).
credits.usedCredits consumed so far this cycle. Sonnet-equivalent tokens: Haiku requests count as 0.33×, Opus as 5×.
credits.remainingallotment - used. Requests fail with 402 AI_CREDITS_EXHAUSTED when this reaches zero.
credits.overage_purchasedAdditional credits purchased outside the plan allotment.
credits.overage_consumedOverage credits consumed.
requests.totalTotal AI requests made this cycle.

Credit accounting

Credits are denominated in Sonnet-equivalent tokens. The model rate-ratios are:
ModelRate-ratio
claude-haiku-4-50.33×
claude-sonnet-4-61.0×
claude-opus-4-75.0×
A 100-token Haiku response consumes ~33 credits; a 100-token Opus response consumes 500 credits. The meta.usage.sonnet_equivalent_tokens field on every AI response shows the credit impact of that specific request.

Error codes

CodeHTTPDescription
INVALID_API_KEY401Invalid or revoked token
MISSING_SCOPE403Key lacks control:read scope