# Get provider earnings overview

> GET /v1/provider/earnings/overview. What the organization's hosts earned in the UTC days from to to (both included) and in the period of the same length just before it, for the Earnings…

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

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

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

What the organization's hosts earned in the UTC days `from` to `to` (both included) and in the
period of the same length just before it, for the Earnings page's overview. It is Legion
Finance section's rollup of legion-billing's ledger scoped to the
organization, so `net_earnings` is exactly what that provider row shows as earned (with test
organizations' rentals included), and a day is the UTC day the ledger entry was posted.

`gross` is what renters were charged for compute and storage on the organization's hosts at the
organization's own prices, `fee` is Legion's commission on it at the rate each rental was created
with, and `net_earnings` is gross minus fee. Backup charges are paid to Ambient and are in
none of these. The renter platform fee that renters pay on top of the organization's prices is all Ambient's and is in none of these either. `fee_correction` is the retroactive correction of Legion's fee to 5% on rentals created
from 2026-10-01 to 2026-10-07, negative, and already part of `fee` (up) and
`net_earnings` (down), so gross minus fee is still net earnings; it is also part of what is
payable. `by_charge_type` leaves it out, so its nets can differ from `net_earnings` by it.

`gpu_hours` are the GPU-hours of the sessions that started in the period. `utilization_bp` is
those GPU-hours over today's listed GPUs times the hours of the period that have happened (Legion Insights definition), in basis points. `realized_price_per_gpu_hour` is the average
price of the organization's sessions, weighted by GPU-hours, in cents: the organization's own
price, before the renter platform fee renters pay on top; `net_per_gpu_hour` is what the
organization kept of it. Money is integer USD cents. The renter is never identified. 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`.

## Responses

### 200

The overview.

- `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
- `current`, ProviderEarningsFigures, required: One period's figures for the organization's hosts. Money is USD cents. See `getProviderEarningsOverview` for the definitions.: `recovered` includes earnings taken back after chargebacks (net of disputes won).
  - `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.
  - `compute_earned`, 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.
  - `storage_earned`, 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_correction`, 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.
  - `recovered`, 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.
  - `paid_out`, 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.
  - `gpu_hours`, number (double), required: GPU-hours of the sessions that started in the period.
  - `rentals`, integer, required: Rentals with charges in the period.
  - `renters`, integer, required: Renters (never identified) with charges in the period.
  - `listed_gpus`, integer, required: GPUs of the organization's hosts that are listed now.
  - `utilization_bp`, integer: GPU-hours over listed GPUs times elapsed hours, in basis points; absent without listed GPUs.
  - `realized_price_per_gpu_hour`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `net_per_gpu_hour`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `by_charge_type`, array of ProviderEarningsChargeType, required
    - `charge_type`, string, required
    - `label`, string, required
    - `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`, ProviderEarningsFigures, required: One period's figures for the organization's hosts. Money is USD cents. See `getProviderEarningsOverview` for the definitions.: `recovered` includes earnings taken back after chargebacks (net of disputes won).
  - `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.
  - `compute_earned`, 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.
  - `storage_earned`, 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_correction`, 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.
  - `recovered`, 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.
  - `paid_out`, 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.
  - `gpu_hours`, number (double), required: GPU-hours of the sessions that started in the period.
  - `rentals`, integer, required: Rentals with charges in the period.
  - `renters`, integer, required: Renters (never identified) with charges in the period.
  - `listed_gpus`, integer, required: GPUs of the organization's hosts that are listed now.
  - `utilization_bp`, integer: GPU-hours over listed GPUs times elapsed hours, in basis points; absent without listed GPUs.
  - `realized_price_per_gpu_hour`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `net_per_gpu_hour`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `by_charge_type`, array of ProviderEarningsChargeType, required
    - `charge_type`, string, required
    - `label`, string, required
    - `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.
- `payable_now`, 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.
- `payable_at_period_end`, 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.
- `paid_out_all_time`, 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.
- `earned_all_time`, 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.
- `payout`, ProviderEarningsPayoutState, required: Whether earnings can be paid out and when. `state` is `ready` (the payout account is ready and not held), `not_set_up` (no payout account yet), `incomplete` (onboarding or Stripe's check is not finished), `held` (Legion holds payouts), `test_organization` (a test organization, which is never paid) or `unavailable` (the payout account could not be read now). `next_payout_on` is the next Monday (UTC), `estimate` what would be paid (the amount payable now, as the weekly run pays all of it), `minimum` the least a payout pays and `will_pay` whether the next run would pay now.
  - `state`, string, required
  - `next_payout_on`, string (date), required
  - `estimate`, 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.
  - `minimum`, Money, required
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `will_pay`, boolean, required
- `test_organization`, boolean, required
- `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
{
  "period": {
    "from": "2026-10-15",
    "to": "2026-10-15"
  },
  "previous_period": {
    "from": "2026-10-15",
    "to": "2026-10-15"
  },
  "current": {
    "gross": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "fee": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "compute_earned": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "storage_earned": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "fee_correction": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "recovered": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "paid_out": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "gpu_hours": 0,
    "rentals": 0,
    "renters": 0,
    "listed_gpus": 0,
    "utilization_bp": 0,
    "realized_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "net_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "by_charge_type": [
      {
        "charge_type": "compute",
        "label": "Compute",
        "gross": {
          "amount_minor": -250,
          "currency": "USD"
        },
        "fee": {
          "amount_minor": -250,
          "currency": "USD"
        },
        "net_earnings": {
          "amount_minor": -250,
          "currency": "USD"
        }
      }
    ]
  },
  "previous": {
    "gross": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "fee": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "compute_earned": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "storage_earned": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "fee_correction": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "recovered": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "paid_out": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "gpu_hours": 0,
    "rentals": 0,
    "renters": 0,
    "listed_gpus": 0,
    "utilization_bp": 0,
    "realized_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "net_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "by_charge_type": [
      {
        "charge_type": "compute",
        "label": "Compute",
        "gross": {
          "amount_minor": -250,
          "currency": "USD"
        },
        "fee": {
          "amount_minor": -250,
          "currency": "USD"
        },
        "net_earnings": {
          "amount_minor": -250,
          "currency": "USD"
        }
      }
    ]
  },
  "payable_now": {
    "amount_minor": -250,
    "currency": "USD"
  },
  "payable_at_period_end": {
    "amount_minor": -250,
    "currency": "USD"
  },
  "paid_out_all_time": {
    "amount_minor": -250,
    "currency": "USD"
  },
  "earned_all_time": {
    "amount_minor": -250,
    "currency": "USD"
  },
  "payout": {
    "state": "ready",
    "next_payout_on": "2026-10-15",
    "estimate": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "minimum": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "will_pay": false
  },
  "test_organization": false,
  "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/overview?from=2026-10-15&to=2026-10-15" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
