Usage

Read AI credits

The authenticated account’s AI credit balance, live lots, current plan grant and paginated journal. Readable by every account role, including accounts with no plan or suspended accounts. Workspace-scoped keys are refused with 403 because the ledger belongs to the whole account. Amounts are integer USD micros (1,000,000 = $1), already including the funded markup. Operator notes, payment references, raw provider usage and internal request keys are never returned. Entries are newest first; follow next_before until null. Inserts made after the first page do not shift older pages. Summary values are current on each request, not pinned to the first page. This read never issues or expires credits. Unknown, duplicate, non-integer or out-of-range query parameters are refused with 400; the error names an unknown parameter, and says a repeated one is sent at most once.

Requires the viewer role or higher.

get/credits

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/credits
  • Auth: HTTP bearer

Query parameters

beforeinteger

Return entries whose id is less than this value. Omit for the newest page.

limitinteger

Entries per page; defaults to 50, at most 100.

Response

Account credit summary and one journal page.

balance_microsinteger required

Sum of unexpired, unspent lot remainders. One USD is 1,000,000 micros.

available_microsinteger required

Balance minus debt and held credits, saturated at the negative safe-integer bound. May be negative; zero while frozen. This is not rollout admission.

held_microsinteger required

Credits reserved for active model calls.

debt_microsinteger required

Outstanding debt, settled by future credit issuance.

frozenboolean required

No recognized plan or account suspended. Credits are retained, but expiry continues.

next_beforeinteger nullable required

Pass as before for older entries; null on the final page. Balances and lots are current on every page.

Changes

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