# Get provider earnings host

> GET /v1/provider/earnings/hosts/{host_id}. The host's row of listProviderEarningsHosts, its earnings in day or week buckets, its uptime per UTC day over the last 30 days, its price against the…

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

`GET https://api.legion.ambient.xyz/v1/provider/earnings/hosts/{host_id}`

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

The host's row of `listProviderEarningsHosts`, its earnings in day or week buckets, its uptime
per UTC day over the last 30 days, its price against the market (the advisor's recommended
price and range for its GPU class), the flags of its current benchmark, what needs attention
and its 25 best rentals of the period. A host that is not the organization's, or does not exist, is
404. Requires `billing.read`.

## Path parameters

- `host_id`, string (uuid), required

## 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 host.

- `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
- `bucket`, FinanceBucket, required
- `host`, ProviderEarningsHostRow, required: One host's earnings and performance in the period. See `listProviderEarningsHosts`.
  - `host_id`, string (uuid), required
  - `name`, string, required
  - `gpu_model`, string, required
  - `gpu_count`, integer, required
  - `state`, string, required: The host's state, as `Host.state`.
  - `listed`, boolean, required
  - `online`, boolean, required: Seen in the last 15 minutes.
  - `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.
  - `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.
  - `gpu_hours`, number (double), required
  - `rentals`, integer, required
  - `utilization_bp`, integer: Absent for a host that is not listed.
  - `fleet_median_utilization_bp`, integer: The median of the platform's listed hosts of the same GPU model; absent with fewer than 3 such hosts.
  - `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.
  - `listed_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.
  - `market_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.
  - `uptime_bp`, integer
  - `attention_count`, integer, required
- `series`, array of ProviderEarningsSeriesPoint, required
  - `start`, string (date), required
  - `end`, string (date), 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.
  - `gpu_hours`, number (double), required
  - `utilization_bp`, integer
  - `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.
  - `by_group`, array of ProviderEarningsGroupValue
    - `key`, string, required: A key of `groups`, or `others`.
    - `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.
- `uptime`, array of ProviderEarningsUptimeDay, required
  - `day`, string (date), required
  - `uptime_bp`, integer: Absent for a day before the host's uptime was counted.
- `price`, ProviderEarningsPrice, required: The host's listed prices against the price advisor's recommendation for its GPU class, in cents per GPU-hour. `position` is `below`, `near` (within 10%) or `above` the market price, absent when there is no market price.
  - `listed`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `listed_interruptible`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `market`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `market_low`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `market_high`, Money
    - `amount_minor`, integer (int64), required: Amount in minor units (cents for USD).
    - `currency`, MoneyCurrency, required: ISO 4217 currency code. Only USD is supported.
  - `confidence`, string, required
  - `position`, string
  - `auto_priced`, boolean: Legion sets the price (the host is on Let Legion decide).
- `benchmark_flags`, array of string, required: The flags of the host's current benchmark, in words.
- `attention`, array of ProviderEarningsAttention, required
  - `id`, string, required: Stable for the host and kind.
  - `host_id`, string (uuid), required
  - `host_name`, string, required
  - `kind`, string, required
  - `severity`, string, required
  - `title`, string, required
  - `detail`, string, required: What was found and what to do, in plain words.
  - `facts`, array of ProviderEarningsFact, required
    - `label`, string, required
    - `value`, string, required
  - `action`, ProviderEarningsAttentionAction, required: What to do about it. `kind` says where the app takes the person: `price_recommendation` (the host's price recommendation), `listing` (the host's listing), `benchmarks` (the host's benchmarks), `host` (the host's page).
    - `kind`, string, required
    - `label`, string, required
- `top_rentals`, array of ProviderEarningsRental, required
  - `rental_id`, string (uuid), required
  - `name`, string, required
  - `host_id`, string (uuid), required
  - `host_name`, string, required
  - `renter`, string, required
  - `tier`, string, required
  - `kind`, string, required
  - `gpu_count`, integer, required
  - `state`, string, required
  - `created_at`, string (date-time)
  - `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.
  - `gpu_hours`, number (double), 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"
  },
  "bucket": "day",
  "host": {
    "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "name": "string",
    "gpu_model": "string",
    "gpu_count": 0,
    "state": "string",
    "listed": false,
    "online": false,
    "gross": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "previous_net_earnings": {
      "amount_minor": -250,
      "currency": "USD"
    },
    "gpu_hours": 0,
    "rentals": 0,
    "utilization_bp": 0,
    "fleet_median_utilization_bp": 0,
    "realized_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "listed_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "market_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "uptime_bp": 0,
    "attention_count": 0
  },
  "series": [
    {
      "start": "2026-10-15",
      "end": "2026-10-15",
      "gross": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "fee": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "net_earnings": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "gpu_hours": 0,
      "utilization_bp": 0,
      "realized_price_per_gpu_hour": {
        "amount_minor": 250,
        "currency": "USD"
      },
      "by_group": [
        {
          "key": "string",
          "net_earnings": {
            "amount_minor": -250,
            "currency": "USD"
          }
        }
      ]
    }
  ],
  "uptime": [
    {
      "day": "2026-10-15",
      "uptime_bp": 0
    }
  ],
  "price": {
    "listed": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "listed_interruptible": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "market": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "market_low": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "market_high": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "confidence": "none",
    "position": "below",
    "auto_priced": false
  },
  "benchmark_flags": [
    "string"
  ],
  "attention": [
    {
      "id": "string",
      "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "host_name": "string",
      "kind": "idle_listed",
      "severity": "high",
      "title": "string",
      "detail": "string",
      "facts": [
        {
          "label": "string",
          "value": "string"
        }
      ],
      "action": {
        "kind": "price_recommendation",
        "label": "string"
      }
    }
  ],
  "top_rentals": [
    {
      "rental_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "name": "string",
      "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "host_name": "string",
      "renter": "Renter 3",
      "tier": "on_demand",
      "kind": "model",
      "gpu_count": 0,
      "state": "string",
      "created_at": "2026-10-15T12:00:00Z",
      "gross": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "fee": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "net_earnings": {
        "amount_minor": -250,
        "currency": "USD"
      },
      "gpu_hours": 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).

### 404

The resource does not exist or belongs to another organization.

### 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/hosts/$HOST_ID?from=2026-10-15&to=2026-10-15" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
