# Get public market

> GET /api/public/market. Anonymous and cross-origin: any page may fetch it without credentials (Access-Control-Allow-Origin: *).

Source: https://legion.ambient.xyz/docs/api/public/get-public-market

`GET https://legion.ambient.xyz/api/public/market`

No key needed.

Anonymous and cross-origin: any page may `fetch` it without credentials (`Access-Control-Allow-Origin: *`). No key is needed and none is read.

One entry per GPU model a renter could rent now, aggregated over every host: never a host, provider, organization, address or rental. `models` is empty when nothing can be rented right now.

Each Cloudflare location keeps the summary for 60 seconds (`X-Legion-Cache: HIT` or `MISS`), with `Cache-Control: public, max-age=30, s-maxage=60, stale-while-revalidate=300`. Errors are not cached.

## Responses

### 200

The market summary.

- `generated_at`, string (date-time), required: When Legion computed the summary (RFC 3339, UTC).
- `currency`, string, required: The currency of every price.
- `models`, array of PublicMarketModel, required: One entry per GPU model with capacity now, by `slug`. Empty when nothing can be rented right now.
  - `slug`, string, required: A stable, URL-safe name of the model (`rtx-4090`).
  - `gpu_model`, string, required: The model's full name as the hosts' NVIDIA driver reports it.
  - `class`, string, required
  - `memory_gib`, integer, required: Memory per GPU in GiB, to the nearest GiB.
  - `from_price_per_gpu_hour`, string, required: The lowest price of one GPU for one hour, a decimal string in `currency` (`"0.45"`). Never a float.
  - `from_interruptible_price_per_gpu_hour`, string: The lowest interruptible price of one GPU for one hour, a decimal string in `currency` (`"0.30"`), over the hosts of this model that offer the interruptible tier and have a GPU free. Absent when there is none. An interruptible rental is stopped when an on-demand rental on the same host needs its GPUs.
  - `max_gpus_on_one_host`, integer, required: The most GPUs of this model free on one host, the largest single rental possible now.
  - `gpus_available`, integer, required: GPUs of this model free now, all hosts together.
  - `hosts_available`, integer, required: Hosts with at least one GPU of this model free now.
  - `rent_url`, string, required: The Legion market filtered to this model. For n ≥ 2 GPUs, add `&min_gpus=<n>`.
  - `median_tflops`, number (double): The median dense FP16/BF16 TFLOPS per GPU, as the Legion agent measured it, across the hosts with this model free now whose latest GPU benchmark Legion kept and did not flag, to one decimal. Absent when no such host. An aggregate per model: never a host's own figure.

Example:

```json
{
  "generated_at": "2026-10-15T12:00:00Z",
  "currency": "USD",
  "models": [
    {
      "slug": "string",
      "gpu_model": "string",
      "class": "datacenter",
      "memory_gib": 0,
      "from_price_per_gpu_hour": "string",
      "from_interruptible_price_per_gpu_hour": "string",
      "max_gpus_on_one_host": 0,
      "gpus_available": 0,
      "hosts_available": 0,
      "rent_url": "string",
      "median_tflops": 0
    }
  ]
}
```

### 405

Any method but GET and OPTIONS (`method_not_allowed`).

### 429

Rate limited (`rate_limited`). Retry after the `Retry-After` seconds.

### 500

An unexpected server error. Safe to retry.

### 502

An upstream could not be used (`upstream_unavailable`): unreachable,
or its answer was malformed. Safe to retry.

### 504

An upstream did not answer within 30 seconds (`upstream_timeout`).

## Errors

- 405 [`method_not_allowed`](https://legion.ambient.xyz/docs/errors#method_not_allowed)
- 429 [`rate_limited`](https://legion.ambient.xyz/docs/errors#rate_limited)
- 502 [`upstream_unavailable`](https://legion.ambient.xyz/docs/errors#upstream_unavailable)

## Example request

```sh
curl -s "https://legion.ambient.xyz/api/public/market"
```
