# Price recommendation

> See the price Legion recommends for a host, how it's made from public data and what renters paid, and the history of your host's listing changes.

Source: https://legion.ambient.xyz/docs/providing/price-recommendation

Legion shows a recommended price for each host, for both prices you can set. It's a suggestion. You set the price, and nothing changes until you save a new one.

## What you get

For a host's GPU class (for example `h100-sxm`), the recommendation has:

- an **on-demand** price and an **interruptible** price, each with a low and a high end of a range;
- a **confidence**: low, medium or high;
- the **basis**: the class, how many Legion hosts of that class are listed, the GPU-hours rented on Legion over 30 days, the class's utilization over 7 days, and the outside sources used, each with the date its price was observed;
- an **explanation** in plain lines;
- the **machine spec**, a table with each resource per GPU, your host's value, the class median and the effect on the price, and the total (`basis.spec` and `basis.spec_adjustment`). It's left out for a class without a host.

When Legion has no data for the class, the answer says it isn't available and gives no price. That's not an error.

In the API, call [getHostPriceRecommendation](https://legion.ambient.xyz/docs/api/hosts/get-host-price-recommendation). It needs the `hosts.manage` permission, like changing a price. An agent can use the `get_price_recommendation` tool; see [Tools reference](https://legion.ambient.xyz/docs/agents/tools).

```sh
curl -s "https://api.legion.ambient.xyz/v1/hosts/HOST_ID/price-recommendation" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```

## How it's made

The same inputs always give the same price. No language model sets a price.

1. **What other marketplaces charge** for the class. Legion takes the latest price from each source seen in the last 7 days and uses the median across sources. Sources are public: public pricing APIs, open datasets and public pricing pages. A research agent reads pricing pages, and Legion checks each price it reports against the page's own text before using it.
2. **What renters paid on Legion** for the class over 30 days, weighted by GPU-hours, for hosts with a price you set. The more GPU-hours rented, up to 500, the more this counts against the outside sources.
3. **Utilization.** A class that's busy over 7 days moves the price up, and an idle one moves it down, by at most 15%.
4. **The host's Legion score** against its class moves the price by at most 10%. See [The Legion score](https://legion.ambient.xyz/docs/renting/legion-score).
5. **The machine spec.** Legion compares what your host provides per GPU with the median of approved hosts that have the same GPU: CPU cores (up to 8%), memory (5%), disk (3%), the PCIe link (2%) and NVLink (2%). Less than the median lowers the price, by at most 20% in all, and half the median takes off the full weight. The spec never raises a price: at or above the median, your host gets the class price. A value your host doesn't report, or that fewer than 2 hosts of the class report, doesn't move the price. Fewer than 4 CPU cores per GPU, or less memory per GPU than the GPU's own memory, is flagged because renters notice it as a bottleneck. The score measures how well the host runs, and the spec measures how much it provides, so nothing counts twice. CPU generation isn't priced. The outside prices and Legion's own are first adjusted to a host with the class's median spec, so a lean or a generous host doesn't pull the class price.
6. **The interruptible price** is the on-demand price times the class's interruptible ratio, between 0.4 and 0.85, and 0.6 when it isn't known. The ratio comes from the marketplaces' prices, and moves to Legion's own as interruptible rentals reach 500 GPU-hours.

**Confidence** is high with at least three independent sources and 50 GPU-hours rented, low with a single source, and medium otherwise.

Prices from the open dataset at [getdeploying.com](https://getdeploying.com) are used under the CC BY 4.0 licence.

## Set the prices

On the host's **Listing** tab, Legion's recommendation for each price is shown under that price, with **Use this price** to fill it in (it isn't saved until you save). **How Legion recommends these prices** opens the confidence and what it is based on. Set the on-demand and interruptible prices yourself, or choose **Let Legion decide** and Legion follows the recommendation for you, within your floor. See [Listing and pricing](https://legion.ambient.xyz/docs/providing/listing-and-pricing).

The answer also says whether auto pricing is on platform-wide (`auto_pricing_enabled`).

## Price history

Every change to a host's listing is recorded: when it was shown or hidden, or when a price changed, with the old and new price and who made the change. The "who" is a person in your organization, an API key of yours, or Legion staff. In the API:

```sh
curl -s "https://api.legion.ambient.xyz/v1/hosts/HOST_ID/listing-history" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```

Each row has the pricing mode, the floor and whether interruptible is offered after the change. A price Legion set, when you switched to auto and at each repricing, has `legion` as the actor and carries the recommendation it followed, with its confidence and basis. Newest first, paged with `cursor`. A save that changes nothing isn't recorded. It needs `hosts.manage`.
