Skip to main content
GET
/
v1
/
usage
Get Usage
curl --request GET \
  --url https://api.happenstance.ai/v1/usage \
  --header 'Authorization: Bearer <token>'
{
  "balance_credits": 123,
  "has_credits": true,
  "purchases": [
    {
      "id": "<string>",
      "credits": 123,
      "purchased_at": "<string>"
    }
  ],
  "usage": [
    {
      "id": "<string>",
      "credit_used": 123,
      "created_at": "<string>",
      "research_id": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

Successful Response

Response from GET /v1/usage - retrieving user's credit purchases and usage history.

balance_credits
integer
required

Current credit balance (can be negative if credits consumed without sufficient balance)

has_credits
boolean
required

Whether the user has credits available (balance > 0)

purchases
ApiPurchaseV1 · object[]
required

List of credit purchases, most recent first

usage
ApiUsageV1 · object[]
required

List of credit usage records, most recent first