Skip to main content
POST https://api.humalike.com/v1/credits/projections/usage-summary
Return your account’s billed usage. The response is a single computed view — 30-day totals across every billable product, a per-product rollup of where the credits went, and a zero-filled 7-day daily series suitable for a chart. Use this endpoint to surface your own billing or usage data in your own dashboards, scripts, or reporting tools, without scraping invoices or the Humalike dashboard. Only completed, billed calls are counted — calls that failed or were never charged are excluded, so the numbers match what you actually paid for. The endpoint is owner-scoped: it only returns the data of the account that made the request, derived from the verified token. There is no user_id parameter and no way to read another account’s usage.

Authorization

Authenticate with your bearer token, the same one used for every other endpoint — either a session token from a signed-in dashboard session or an ak_ API key issued from the Humalike dashboard. See Authentication.
Authorization
string
required
Your bearer token: Bearer <token>.

Request body

The endpoint takes no parameters — the calling identity defines whose usage is returned. Send an empty JSON object:
{}

Response

A single UsageSummary object covering the last 30 days of billed usage.
total_calls
integer
Total billed calls in the last 30 days across every product.
total_credits
integer
Total credits charged in the last 30 days. This is what you actually paid for the work done.
per_component
ComponentUsage[]
One entry per Humalike product your account used in the window (for example, social-learning, personas, theoryofmind, social-observability, social-memory). Products your account did not use are omitted.
daily_series
DailyPoint[]
A zero-filled series of the last 7 UTC days, oldest first, suitable for rendering a bar chart. Days with no billed calls are present with requests: 0 so the series always has seven entries.

Example response

200 OK
{
  "total_calls": 142,
  "total_credits": 38211,
  "per_component": [
    { "component": "social-learning",       "calls": 87, "credits": 21044 },
    { "component": "personas",              "calls": 31, "credits": 12500 },
    { "component": "theoryofmind",          "calls": 18, "credits":  3210 },
    { "component": "social-observability",  "calls":  6, "credits":  1457 }
  ],
  "daily_series": [
    { "date": "Wed", "requests":  4 },
    { "date": "Thu", "requests": 11 },
    { "date": "Fri", "requests":  7 },
    { "date": "Sat", "requests":  0 },
    { "date": "Sun", "requests":  2 },
    { "date": "Mon", "requests":  9 },
    { "date": "Tue", "requests": 13 }
  ]
}

Errors

StatusCodeWhen
401UNAUTHORIZEDThe bearer token is missing, invalid, or expired.
403forbiddenThe credentials are valid but not permitted to read usage.
502UPSTREAM_ERRORA dependency the request relies on was unavailable. Retry.
See Errors for the full envelope shape.

Example

curl https://api.humalike.com/v1/credits/projections/usage-summary \
  -H "Authorization: Bearer $HUMALIKE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'