Usage

Usage Ledger

Unified credit history — debits (scrapes) AND credits (top-ups).

This is the feed the credits page renders. Before this endpoint the page only ever showed debits, so a user could watch their balance go down but never saw the matching +N credits when they bought a pack. We merge:

  1. Debits — completed jobs that actually charged credits (credits_charged > 0) from our Postgres search_jobs.
  2. Credits — personal top-ups from the Supabase credit_purchases table (via CreditsService.list_purchases), the same rows the Orders page shows.

Both are sorted newest-first and capped at limit. If Supabase is unreachable / unconfigured (local dev, CI) the credit side is simply empty and the feed degrades to debits-only — never an error.

get/api/usage/ledger

Request

  • Base URL: https://api.kolens.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.kolens.ai/api/usage/ledger
  • Auth: HTTP bearer

Query parameters

limitinteger

Headers

x-kolens-user-idstring nullable

Response

Successful Response

user_idstring required
limitinteger required

Changes

No recorded changes to this operation across all 1 revision of this API.