# The organization's earnings by one dimension

> GET /v1/provider/earnings/breakdown. The period's charges on the organization's hosts grouped by dimension, largest net earnings first, the first limit groups in rows, the rest added up in…

Source: https://legion.ambient.xyz/docs/api/billing/get-provider-earnings-breakdown

`GET https://api.legion.ambient.xyz/v1/provider/earnings/breakdown`

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

The period's charges on the organization's hosts grouped by `dimension`, largest net earnings
first, the first `limit` groups in `rows`, the rest added up in `others` and every group in
`total`. Each row carries the previous period's net earnings for the change. `renter` groups by
the organization's renters, who are never identified: they are named `Renter 1`, `Renter 2`
and so on in the order they first rented from the organization, which does not change. GPU-hours are absent for `rental_type` and `charge_type`. Same definitions as
`getProviderEarningsOverview`. Requires `billing.read`.

## Query parameters

- `from`, string (date), required: The first UTC day of the period, included.
- `to`, string (date), required: The last UTC day of the period, included. Not before `from`, and at most 731 days after it, or the request is 400 `invalid_range`.
- `dimension`, string, required
- `limit`, integer

## Responses

### 200

The breakdown.

- `dimension`, string, required
- `period`, FinancePeriod, required: UTC days `from` to `to`, both included.
  - `from`, string (date), required
  - `to`, string (date), required
- `previous_period`, FinancePeriod, required: UTC days `from` to `to`, both included.
  - `from`, string (date), required
  - `to`, string (date), required
- `rows`, array of ProviderEarningsBreakdownRow, required
  - `key`, string, required: The host's ID for `host`, `renter-n` for `renter`, otherwise the value.
  - `label`, string, required
  - `host_id`, string (uuid)
  - `gross`, 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.
  - `fee`, 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.
  - `net_earnings`, 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.
  - `previous_net_earnings`, 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.
  - `share_bps`, integer, required: Share of the total net earnings, in basis points.
  - `rentals`, integer, required
  - `renters`, integer, required
  - `gpu_hours`, number (double)
  - `groups`, integer: How many groups an `others` row adds up.
- `others`, ProviderEarningsBreakdownRow
  - `key`, string, required: The host's ID for `host`, `renter-n` for `renter`, otherwise the value.
  - `label`, string, required
  - `host_id`, string (uuid)
  - `gross`, 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.
  - `fee`, 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.
  - `net_earnings`, 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.
  - `previous_net_earnings`, 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.
  - `share_bps`, integer, required: Share of the total net earnings, in basis points.
  - `rentals`, integer, required
  - `renters`, integer, required
  - `gpu_hours`, number (double)
  - `groups`, integer: How many groups an `others` row adds up.
- `total`, ProviderEarningsBreakdownRow, required
  - `key`, string, required: The host's ID for `host`, `renter-n` for `renter`, otherwise the value.
  - `label`, string, required
  - `host_id`, string (uuid)
  - `gross`, 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.
  - `fee`, 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.
  - `net_earnings`, 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.
  - `previous_net_earnings`, 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.
  - `share_bps`, integer, required: Share of the total net earnings, in basis points.
  - `rentals`, integer, required
  - `renters`, integer, required
  - `gpu_hours`, number (double)
  - `groups`, integer: How many groups an `others` row adds up.
- `sync`, FinanceSync, required: The state of the finance rollup. `synced_at` is when Legion last copied billing's ledger, and `ledger_as_of` the time billing read it at. `stale` is true when the last copy is more than 15 minutes old.
  - `synced_at`, string (date-time)
  - `ledger_as_of`, string (date-time)
  - `last_full_rebuild_at`, string (date-time)
  - `stale`, boolean, required
  - `last_error`, string: The last sync's failure in words, absent when it succeeded.

Example:

```json
{
  "dimension": "string",
  "period": {
    "from": "2026-10-15",
    "to": "2026-10-15"
  },
  "previous_period": {
    "from": "2026-10-15",
    "to": "2026-10-15"
  },
  "rows": [
    {
      "key": "string",
      "label": "string",
      "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "gross": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "fee": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "net_earnings": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "previous_net_earnings": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "share_bps": 0,
      "rentals": 0,
      "renters": 0,
      "gpu_hours": 0,
      "groups": 0
    }
  ],
  "others": {
    "key": "string",
    "label": "string",
    "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "gross": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "fee": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "previous_net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "share_bps": 0,
    "rentals": 0,
    "renters": 0,
    "gpu_hours": 0,
    "groups": 0
  },
  "total": {
    "key": "string",
    "label": "string",
    "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "gross": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "fee": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "previous_net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "share_bps": 0,
    "rentals": 0,
    "renters": 0,
    "gpu_hours": 0,
    "groups": 0
  },
  "sync": {
    "synced_at": "2026-10-15T12:00:00Z",
    "ledger_as_of": "2026-10-15T12:00:00Z",
    "last_full_rebuild_at": "2026-10-15T12:00:00Z",
    "stale": false,
    "last_error": "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.

## Errors

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

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/provider/earnings/breakdown?from=2026-10-15&to=2026-10-15&dimension=host" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
