# List the organization's ledger entries

> GET /v1/billing/ledger. Every change to the organization's balance and provider earnings, newest first.

Source: https://legion.ambient.xyz/docs/api/billing/list-ledger-entries

`GET https://api.legion.ambient.xyz/v1/billing/ledger`

Authenticate with an API key: `Authorization: Bearer $LEGION_API_KEY`.

Every change to the organization's balance and provider earnings,
newest first. Entries are never changed or removed; a correction is a
new entry. Paging never skips or repeats an entry, and entries newer
than the first page's newest never appear on later pages; start again
from the first page to see them. A cursor is valid only for the
organization it was returned for, and not under the other `account`
filter (400 `invalid_cursor`). Requires `billing.read`.

## Query parameters

- `cursor`, string: Opaque cursor from a previous page's `next_cursor`.
- `limit`, integer
- `account`, LedgerAccount: Only entries of this account. Both accounts when absent.

## Responses

### 200

A page of entries.

- `items`, array of LedgerEntry, required
  - `id`, string, required: Opaque, stable identifier of the entry.
  - `account`, LedgerAccount, required: `balance`: the prepaid balance renting spends from. `earnings`: what the organization's hosts earned, less payouts.
  - `amount`, SignedMoney, required: An amount of money in minor units (cents for USD) that may be negative: a debit, a balance below zero, or an overpaid provider.
    - `amount_minor`, integer (int64), required
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `cause`, LedgerCause, required: `usage`: a billed interval of a running rental (a debit on `balance` for the renter, a credit on `earnings` for the provider). `top_up`, `adjustment`: changes to the balance made by Ambient. `payout`: money Ambient paid to the provider. `earnings_recovery`: earnings Ambient took back from a provider implicated in payment fraud. `refund`, `chargeback`: money returned to the organization's payment method outside a Legion top-up, debited from `balance`. `storage`: the disk a stopped rental kept on its host while the organization had credit, debited and credited as `usage` is. `backup`: a backup's charge (negative) or refund (positive) on `balance`, and a further download link's charge; all of it Ambient's, never on `earnings`. Promo codes, all on `balance`: `promo_credit` (+) promo credit granted, `promo_discount` (+) a usage discount's rebate of a compute charge, `promo_expiry` (-) promo credit that expired unused, `promo_clawback` (-) promo credit taken back (a revoke, or the refund or dispute of the top-up that earned a bonus). `transfer`: a charge (negative) for data Legion sent out, on `balance`: a workspace export's download link or relay traffic (SSH gateway, exposed ports, web terminal) above the month's free allowance; all of it Ambient's, never on `earnings`. `dispute_clawback` (on `earnings`): earnings taken back from a provider because the renter's bank reversed the payment that funded the rentals (a chargeback); positive when the dispute was won and the earnings were given back.
  - `rental_id`, string (uuid): The rental billed, on `usage` entries, and the rental a `backup` or `transfer` charge was for.
  - `label`, string: : plain words for what the entry was for, set on `transfer` entries: `Data transfer (exports)` (a workspace export's download link), `Data transfer (relay)` (SSH, exposed-port and web terminal traffic above the free allowance). Absent on other causes.
  - `reason`, string: Ambient's note on `top_up`, `adjustment`, `payout`, `refund` and `chargeback` entries.
  - `occurred_at`, string (date-time), required: End of the billed interval for `usage`; when Ambient recorded the credit otherwise.
  - `recorded_at`, string (date-time), required
  - `promo`, SignedMoney: : the part of `amount` that was promo credit, same sign (a $10.00 charge paid $6.00 from promo credit has amount -1000 and promo -600). Absent when none.
- `next_cursor`, string

Example:

```json
{
  "items": [
    {
      "id": "string",
      "account": "balance",
      "amount": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "cause": "usage",
      "rental_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "label": "string",
      "reason": "string",
      "occurred_at": "2026-10-15T12:00:00Z",
      "recorded_at": "2026-10-15T12:00:00Z",
      "promo": {
        "amount_minor": -250,
        "currency": "USD"
      }
    }
  ],
  "next_cursor": "string"
}
```

### 400

The request is malformed or fails validation. An image reference that
is not a container image reference answers `invalid_image_reference`.

### 401

Missing, unknown, expired or revoked credentials.

### 403

The caller lacks the permission this operation requires (`forbidden`),
or signed in without having joined an organization yet
(`no_organization`; `getOnboarding` and the invitation and
organization operations under it work), or could not sign in
(`email_unverified`, `account_conflict`, and `domain_not_allowed`). `not_invited` is no longer returned to
session tokens.

`access_not_approved`: a signed-in person who is not approved
for the beta yet. Every operation that takes a credential answers it to
them, except `getMe` and `joinMyWaitlist`; the problem carries
`access` (`waitlisted` or `not_requested`, and the email). Approved
means a member of an organization, holding a pending invitation, or Legion; an API key always belongs to a member.

`oauth_token_mcp_only`: the caller sent an OAuth access token (`lgo_`), which is accepted
only by `mcpMessage` and the tool calls it dispatches. Every other operation answers it, whatever
the token's scope. Use an API key or the Legion web app.

`org_suspended`: the caller's organization is suspended. Every operation that takes a
credential answers it, by session or API key, except `getMe` (which shows `org.suspended_at` and
`org.suspension_reason`) and the support operations under `/v1/support/`.

`terms_not_accepted`: an approved caller who has not accepted
the current version of the Terms of Use and the Acceptable Use Policy. Every operation that takes a credential answers it, except `getMe`,
`acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations
(`listRentals`, `stopRental`, `deleteRental`, `listHosts`,
`updateListing` with `listed` false, `removeHost`); the problem
carries `legal`. An API key acts for the person who created it, so it
is refused until that person accepts. Terminal
operations also return
`session_required` (called with an API key) and `step_up_required`
(neither a sign-in nor a step-up challenge within the step-up window).

### 500

An unexpected server error. Safe to retry.

### 503

The billing service failed or did not answer within 3 seconds
(`billing_unavailable`). Nothing changed; retry with backoff.

## Errors

- 400 [`invalid_cursor`](https://legion.ambient.xyz/docs/errors#invalid_cursor)
- 403 [`no_organization`](https://legion.ambient.xyz/docs/errors#no_organization)
- 503 [`billing_unavailable`](https://legion.ambient.xyz/docs/errors#billing_unavailable)

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/billing/ledger" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
