# Set the destinations blocked for rentals on a host

> PUT /v1/hosts/{host_id}/network. Changes the fields given and leaves the others as they are.

Source: https://legion.ambient.xyz/docs/api/hosts/update-host-network

`PUT https://api.legion.ambient.xyz/v1/hosts/{host_id}/network`

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

Changes the fields given and leaves the others as they are.

`blocked_cidrs` replaces the host's blocked destinations: IPv4 ranges (at most 32, each no
wider than /8) that no rental on this host can reach, in every egress mode, for example the
provider's own networks. Private and other reserved ranges and outbound email (TCP port 25)
are always blocked and need not be listed. Every live rental on the host gets a new network
`revision` in the same transaction, so the host's agent applies the change on its next sync.

`require_allowlist`: when true, rentals created on this host from then on start in
`enforce` and can reach only the allow-list, whatever their organization chose (an
organization Legion set to `open` stays open). Rentals already running keep the
mode they started in. Offers show it as `restricted_network`. Turning it on needs the host's
agent to advertise `egress_enforce_v1` (409 `enforce_unavailable`); turning it off always works.

Repeating the current values changes nothing. Needs `hosts.manage`.

## Path parameters

- `host_id`, string (uuid), required

## Request body

- `blocked_cidrs`, array of string
- `require_allowlist`, boolean: Rentals created on this host from now on can reach only the allow-list.

Example:

```json
{
  "blocked_cidrs": [
    "192.0.2.0/25"
  ],
  "require_allowlist": false
}
```

## Responses

### 200

The updated host.

- `maintenance`, MaintenanceWindow: . The host's open maintenance window (`scheduled`, `closing`, `active` or `overrun`), for its provider. Absent when there is none.
- `id`, string (uuid), required
- `org_id`, string (uuid), required
- `own_use_price_per_gpu_hour`, Money: . What the organization's own use of this host (`Rental.own_use`) would pay per GPU-hour on demand if started now: Ambient's platform fee, the greater of `own_use_fee_bps` of the host's own listed price (its last price while unlisted) and `own_use_fee_floor_per_gpu_hour`. The organization earns nothing on own use, and any paying renter takes the GPUs from it. Since a host with no price pays the floor; absent only when the quote is 0.
- `own_use_fee_bps`, integer: . The own-use platform fee's rate in basis points of the host's listed price (500 is 5%).
- `own_use_fee_floor_per_gpu_hour`, Money: . The least own use pays per GPU-hour: the own-use fee is the greater of `own_use_fee_bps` of the listed price and this floor, so a host that was never priced pays the floor.
- `renter_fee_bps`, integer: . The renter platform fee, in basis points, renters pay on top of this host's prices on a rental created now (500 is 5%). All of it is Ambient's; it never changes the provider's earnings.
- `renter_price_per_gpu_hour`, Money: . What renters see and pay per GPU-hour on demand for this host: the listing's `price_per_gpu_hour` plus the renter platform fee. Absent while the host has no price.
- `renter_interruptible_price_per_gpu_hour`, Money: . The interruptible floor as renters see it, with the renter platform fee. Absent when the host is not offered as interruptible.
- `name`, FriendlyName, required: The host's friendly name, its display name and its mesh peer name, so its internal DNS name on the overlay is `<name>.<mesh domain>`. Assigned at enrollment; `renameHost` changes it.
- `hostname`, string, required: The machine's own hostname, as its agent reported it at enrollment.
- `state`, HostState, required: `pending`: registered, awaiting operator review. `approved`: may be listed and rented. `quarantined`: removed from offers by an operator; no new rentals. `removed`: removed by its provider, Legion or the timeout; a soft delete. The host is out of offers and the default lists, its agent credentials are revoked and the machine comes back only by enrolling again as a new host. Never left again.
- `quarantine_reason`, string
- `credentials_revoked_at`, string (date-time): When the host's agent credentials were revoked (quarantine or `revokeHostCredentials`). Absent while they are valid. The agent is refused on every request (`agent_credentials_revoked`) and is issued no certificate again; the machine comes back only by enrolling again with a new enrollment token, as a new host.
- `online`, boolean, required: Whether the agent synced within the last 90 seconds.
- `last_seen_at`, string (date-time): When the agent last synced. Absent until it has.
- `stale`, boolean: True while the agent has not synced for `HOST_STALE_AFTER` (24 hours by default). A stale host is not offered and is removed after `HOST_AUTO_REMOVE_AFTER` (7 days by default) if it has no rental to act on. A sync clears it. Absent means false.
- `removed_at`, string (date-time): When the host was removed. Present exactly when `state` is `removed`.
- `removed_reason`, HostRemovedReason: Why a host was removed. `provider`: its organization removed it. `admin`: Legion removed it. `admin_force`: Legion removed it and ended its rentals. `timed_out`: Legion removed it after its agent had not synced for `HOST_AUTO_REMOVE_AFTER` (7 days by default) and it had no rental to act on.
- `removal`, HostRemoval: . A removal waiting for the renters' files on the host to go (`stored_data` `when_empty`): while `waiting` the host is out of offers and its rentals cannot start; it is removed by itself once no rental on it has files left, at the latest at `deadline`. Kept on the host after it is removed.
  - `requested_at`, string (date-time), required: When the wait began: the request, or the decision to delete the files.
  - `stored_data`, HostStoredDataChoice, required: What it waits for: `when_empty`, the renters' files to go; `delete_now`, the host's agent to confirm it deleted them (\"Removing: deleting renters' files\").
  - `reason`, HostRemovedReason, required: The `removed_reason` the host is removed with.
  - `waiting`, boolean, required: True until the host is removed: "removing when empty".
  - `deadline`, string (date-time), required: When the host is removed at the latest: 72 hours after `requested_at` for `when_empty` (files left then are deleted, except that a renter's backup or export still running is waited for), 1 hour for `delete_now`.
  - `stored_data_rentals`, array of HostStoredDataRental, required: The rentals whose files are still on the host; empty once it is removed.
    - `id`, string (uuid), required
    - `name`, FriendlyName: A host's or rental's friendly name: a lowercase DNS label that starts with a letter and does not end with a hyphen. Unique across all hosts and rentals and never reused. A host's is generated as adjective-noun (`amber-falcon`) and can be changed by its owner; a rental's is generated as adjective-noun plus four base36 characters (`quiet-river-7k2f`) and never changes.
    - `state`, RentalState, required: `starting`: GPUs allocated, waiting for the agent to start the container. Not billed. While the rental's `image_phase` is `fetching` the agent does not know it yet. `running`: the container runs. Billed per second. `exited`: the host reports the container is not running, for example after a crash; the host is restarting it. GPUs stay reserved. Not billed; returns to `running` when the host reports it running again. `stopping`: stop requested, waiting for the agent. Not billed. Becomes `stopped` without the agent once the host has been offline for 90 seconds. `stopped`: GPUs released, workspace kept on the host. GPU time is not billed. Storage is billed per GiB while the organization has credit, except for an `interruption_behavior: delete` rental, which never stops with data. `host_offline`: the host stopped syncing. Not billed; returns to `running` when the host syncs again, and becomes `failed` once the host has not synced for `HOST_STALE_AFTER` (24 hours;). `deleting`: delete requested, waiting for the agent. Not billed. Becomes `deleted` without the agent once the host has been offline for 90 seconds. `deleted`: container and workspace removed. Final. `failed`: the agent could not start or keep running the container. GPUs released. The rental can only be deleted.
    - `estimated_size_bytes`, integer (int64), required: The size of its files on the host; with `estimate_basis` `disk_share` an upper bound.
    - `estimate_basis`, BackupEstimateBasis, required: . What a backup's quote was computed on. `disk_used`: the size the rental's host last reported its workspace uses (`disk_used_gib`). `disk_share`: the host does not report it (a host whose disk quota is not enforced, for example not on XFS), so the quote is the rental's whole disk share (`resources.disk_gib`): an upper bound, "up to" this price, trued down to the real size when the backup is ready. Either way the charge never exceeds the quote: a backup larger than its estimate (a stale `disk_used_gib`) is charged the quote, not more.
    - `delete_after`, string (date-time): When its files are deleted (its `delete_after`); absent while held.
    - `backup_state`, BackupState: Its renter's newest backup, when it has one.
    - `rented_by_you`, boolean: The caller's own organization rented it. Only on the public listener; absent means false.
- `observed_country`, CountryCode: The country of the address the host's agent connects from, looked up in DB-IP's IP to Country Lite database (IP geolocation by DB-IP, https://db-ip.com, CC BY 4.0). Absent until an agent's address has resolved to a country.
- `country_verification`, CountryVerification: How the provider's declared country (`Listing.country`) compares with the country of the address the host's agent connects from (looked up in DB-IP's IP to Country Lite database: IP geolocation by DB-IP, https://db-ip.com, CC BY 4.0). `verified`: they are the same. `mismatch`: both are known and differ (a VPN, a cloud egress or a wrong declaration). `unverified`: either is unknown.
- `gpu_model`, string, required
- `gpu_class`, GpuClass, required: Legion's canonical class of a GPU model: one of `b300`, `b200`, `gh200`, `h200`, `h100-sxm`, `h100-pcie`, `h100-nvl`, `a100-80gb`, `a100-40gb`, `l40s`, `l40`, `l4`, `a10`, `a40`, `a6000`, `rtx-6000-ada`, `rtx-pro-6000`, `rtx-5090`, `rtx-4090`, `rtx-3090`, `v100`, `mi300x`, or `other-<slug of the model>` for a model that matches none of them. Derived from the model name and the GPU memory, so hosts of one class are comparable for pricing.
- `gpu_memory_mib`, integer (int64), required
- `gpu_count`, integer, required
- `gpus_free`, integer, required
- `total`, Resources, required
  - `cpu_cores`, integer, required
  - `memory_mib`, integer (int64), required
  - `disk_gib`, integer (int64), required
- `driver_version`, string
- `platform`, Platform: The OCI platform of the machine a host's containers run on: `os/architecture` or `os/architecture/variant`, for example `linux/amd64`, `linux/arm64` or `linux/arm/v7`. It is what an image's `platforms` list is matched against. Reported by the agent; absent for hosts whose agent predates it or cannot tell.
- `compute_capability`, ComputeCapability: CUDA compute capability as `major.minor`, as `nvidia-smi --query-gpu=compute_cap` reports it (`8.0` A100, `8.9` L40S and RTX 4090, `9.0` H100 and H200, `10.0` B200). Compare numerically by major, then minor, never as a string or a float: `10.0` is above `9.0`. Reported by the agent; absent when the agent predates it or the driver is too old to answer. On a host or an offer it is the lowest across the host's GPUs.
- `agent_version`, string
- `listing`, Listing, required: `country` is where the host is, as its provider declares it: absent in a request leaves it as it is. Legion checks it against the host's latencies (`location_mismatch`) and against the country of the agent's address (`country_verification` on `Host` and `Offer`). `price_per_gpu_hour` is the **on-demand** price. `interruptible_price_per_gpu_hour` is the floor (reserve price) of the host's spot auction for interruptible rentals: at least 1 cent and at most `price_per_gpu_hour`, else 400 `invalid_interruptible_price`. In a response, absent means the host is not offered as interruptible. In a listing write, absent keeps the current interruptible price (it must still be at most the new `price_per_gpu_hour`), and an explicit `null` stops offering the tier (running interruptible rentals keep their price and continue). While it stands, interruptible rentals on the host pay its spot auction's clearing price: never under this floor (unless their own limit, set when the floor was lower, is), never over their own limit.
  - `listed`, boolean, required: Whether the host appears in offers.
  - `price_per_gpu_hour`, 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.
  - `interruptible_price_per_gpu_hour`, Money: The floor of this host's spot auction for interruptible rentals: the lowest price per GPU-hour an interruptible rental pays. An interruptible rental runs on GPUs no on-demand rental needs and pays the auction's clearing price (never under the floor, never over its own maximum). An on-demand rental on the same host that needs its GPUs stops it (`stop_reason` `preempted`), and so can a bid that beats its maximum (`outbid`). Between 1 cent and `price_per_gpu_hour`. In a response, absent: the host is not offered as interruptible. In a listing write, absent keeps the current price and `null` stops offering the tier.
  - `country`, CountryCode: An ISO 3166-1 alpha-2 country code, two capital letters. A declared listing country (`Listing.country` in a write) must be one of the 249 officially assigned codes: `UK` is not one, the United Kingdom is `GB`, and `EU`, `UN` and the other reserved or exceptional codes are refused with 400 `invalid_country`. Filters and reads keep the two-letter shape only.
  - `pricing_mode`, PricingMode: `manual` (the default) or `auto`, "Let Legion decide": Legion sets both prices from its price recommendation and reprices hourly, aiming at the provider's revenue at a healthy utilization rather than at bookings. See `updateListing`.
  - `min_price_per_gpu_hour`, Money: The floor of auto pricing: Legion never sets the on-demand price below it. Absent: no floor. Kept, and unused, in manual mode.
  - `offer_interruptible`, boolean: In auto mode, whether Legion also offers the host as interruptible, at its recommended interruptible price (at most the on-demand price). Kept, and unused, in manual mode.
  - `auto_priced_at`, string (date-time): When Legion last set the host's prices (switching to auto, or a repricing). Absent until it has.
  - `visibility`, ListingVisibility: Whether renters can find the host, as far as the benchmark gate and `listed` decide; the host's `state`, `online` and its other holds are their own fields. A host that never completed a benchmark is left out of `listOffers` and `getOffer` however it is listed: the provider can set prices and list at once, and the listing shows by itself when the host's first benchmark run completes (the agent runs it on its own once the host is idle, `requestHostBenchmark` asks for one). After that the normal review outcome applies, unchanged. A run that measured no figure at all is kept and does not count. - `not_listed`: `listed` is false. - `awaiting_first_benchmark`: listed, and no benchmark run has completed yet. Show "Waiting for first benchmark". - `first_benchmark_failed`: as `awaiting_first_benchmark`, and a run was kept that measured nothing. The provider can ask for another run (`requestHostBenchmark`). - `visible`: the benchmark gate is passed (`first_benchmark_at` is set).
  - `first_benchmark_at`, string (date-time): When Legion first kept a completed benchmark run of the host. Absent until then; never changes afterwards.
- `storage_price_per_gib_month`, Money: What a stopped rental on this host is charged per GiB per 730-hour month while its organization has credit: the host's own rate, or the platform's when it has none. A rental keeps the rate of its host at creation. Absent when storage is free. The provider earns the same share of storage charges as of GPU time (`provider_share_bps`).
- `provider_share_bps`, integer, required: The share of the host's own price (the listing's, before the renter platform fee), in basis points (hundredths of a percent), that a rental created now on this host earns the provider: 10000 minus the platform commission. At 9000 a rental charged $1.00 at the provider's price earns the provider $0.90 (the commission is rounded to the cent from the amount charged). Renters pay the renter platform fee (`renter_fee_bps`) on top of the provider's price; none of it comes out of the provider's earnings. The platform sets it and it is the same for every host. A rental keeps the share it was created with, so a change applies to new rentals only.
- `runtime`, RuntimeAvailable, required: Whether a rental on this host is created with the Legion runtime: the host's agent supports it and Legion offers it to that host. When false the rental runs its image's own sshd on port 22, as before. Rentals that already exist never change.
- `offer_hold`, OfferHold: Present while the host is not offered for rent, and no rental can be created on it, because its agent is too old: Legion enforces a minimum runtime ABI (`RUNTIME_MIN_ABI`) and the agent advertised a lower one, or none. Upgrading the agent clears it on the next sync. Absent when the host meets the minimum or none is configured. Rentals that already exist on the host are not affected. It says nothing about the other reasons a host may not be offered (not approved, not listed, offline).
  - `reason`, string, required
  - `min_abi`, integer, required: The configured minimum runtime ABI.
  - `agent_abi`, integer, required: The highest runtime ABI the agent advertised on its last sync; 0 when it advertised none (an agent from before the runtime).
- `disk_hold`, DiskHold: Present while an approved host's disk is not ready for per-rental disk limits: its agent does not send the disk status (`disk_quota_v1`), the agent reports that it cannot enforce the limits, or the usable disk is below 128 GiB per GPU. Advisory: the host is still offered for rent and rentals can still be created on it. The next sync that fixes the cause clears it. Absent on hosts that are not approved.
  - `reason`, string, required: `agent_too_old` (the agent does not advertise `disk_quota_v1`), `disk_below_minimum` (usable disk divided by the GPU count is below 128 GiB), `unknown` (the agent reports the disk not enforced without a reason), or the `reason` of the agent's `AgentDiskStatus` as it sent it. New values can appear without notice: show one you do not know as "other".
- `clock`, HostClock: The host's clock as its agent last measured it on a sync. Absent until an agent that measures it has synced. A rental container checks web-terminal certificates with this clock, so a host far off cannot open the web terminal; the agent turns on time sync where none is running.
  - `offset_ms`, integer (int64), required: The host's clock minus Legion's, in milliseconds. Negative is slow.
  - `ntp_synchronized`, boolean: Whether the host's kernel clock is synchronized by NTP. Absent when the agent could not tell.
  - `reported_at`, string (date-time), required: When Legion stored this measurement. It is rewritten at least every 5 minutes while the agent syncs.
- `isolation`, HostIsolation, required: . User-namespace isolation (Docker `userns-remap`): root in a rental container is an unprivileged ID on the host, not root. `verified` is true while the host's agent reports it on its syncs (capability `userns_remap_v1`, sent only when Docker runs with the remap and a probe container under it opened the GPUs). From `required_from` a host that is not verified is not offered for rent: no new rental or service replica is created on it. Rentals already on it continue, and a renter can still start a stopped rental of its own that is on it. From the agent turns it on by itself when the host is idle (no rentals, no other containers), and `state` says where it stands; `fix_command`, run on the host while it has no rentals, is the manual way. The host is offered again at the agent's next sync after the probe passes.
  - `verified`, boolean, required: Whether the agent reported verified user-namespace isolation on its last sync.
  - `required_from`, string (date-time), required: When isolation becomes a condition of being offered. The same fixed time for every host.
  - `blocked`, boolean, required: True from `required_from` while `verified` is false. The host is not offered and nothing new is placed on it.
  - `fix_command`, string: The command to run on the host, as root, while it has no rentals. Absent while `verified` is true.
  - `state`, HostIsolationState: . Where the host's agent stands on turning isolation on by itself, as it last reported. Absent while the agent never reported one (agents before). `on`: on and the GPU check passed. `waiting_for_idle`: off; the agent turns it on by itself when the host has no rentals. `switching`: off; the agent is turning it on now (Docker restarts once), and no new rental or service replica is placed on the host until it is done. `other_containers`: off; the host runs other containers, so the provider runs `fix_command` once they are stopped. `failed`: off; the agent's last attempt failed (`failure`), Docker was put back as it was, and it tries again at `retry_at`. `probe_failed`: Docker runs with user namespaces but the GPU check under them fails. `unsupported`: the agent cannot turn it on by itself (`failure`). `unknown`: a value Legion does not know.
  - `failure`, HostIsolationFailure: . Why isolation is not on, with `state` `failed`, `unsupported` or `probe_failed`. `docker_not_remapped`: dockerd flags override daemon.json. `gpu_probe_failed`: the GPU check under user namespaces failed. `docker_restart_failed`: Docker did not restart. `daemon_json`: daemon.json cannot be read or is invalid. `rootless`: rootless Docker is not supported. `remap_user`: daemon.json names another remap user. `other`: anything else, including a value Legion does not know.
  - `retry_at`, string (date-time): . With `state` `failed`, when the agent tries again by itself. Absent otherwise.
- `start_hold`, HostStartHold: . New rentals are paused on the host because models keep failing to start on it: 2 or more serve rentals or service replicas, of any organization, failed to start within an hour (their service reported an error before it was ever ready, or a replica did not start in time). While it lasts the host gets no new rental or replica and is not offered; running rentals are not touched. It ends by itself at `until`, when a model starts on the host, or when the provider ends it (`releaseHostStartHold`). Each hold that starts within 24 hours of the last one's end lasts longer: 30 minutes, 2 hours, 8 hours, then 24 hours. Absent while the host is not paused.
  - `since`, string (date-time), required
  - `until`, string (date-time), required: When the pause ends by itself.
  - `failures`, integer, required: How many models failed to start in the hour that started the pause.
  - `last_reason`, string, required: The code of the last failure: a `ServeFailure.reason` (for example `gpu_memory_insufficient`), `service_error` when the agent gave none, `start_timeout` or `rental_failed`.
  - `message`, string, required: The pause in plain words, for example `New rentals paused on rustic-walnut: 3 models failed to start in 20 minutes, last reason: not enough GPU memory.`
- `gpu_memory_outside_legion`, array of HostGPUForeignMemory: . The GPUs whose memory is partly held by something outside Legion (another workload or a desktop session on the machine), as the agent last reported it (`gpu_foreign_memory_v1`), by GPU index. Absent or empty when none is. A GPU with more than a fifth of its memory in use outside Legion is not offered (`offered` false) until that use ends; a model rented on the others needs its memory from what is left.
  - `index`, integer, required
  - `memory_mib`, integer (int64), required: The GPU's memory.
  - `foreign_memory_mib`, integer (int64), required: Memory in use outside Legion's containers.
  - `offered`, boolean, required: Whether renters can rent the GPU while this use lasts (at most a fifth of its memory).
- `blocked_cidrs`, array of string, required: IPv4 ranges no rental on this host can reach (`updateHostNetwork`). Sorted.
- `require_allowlist`, boolean, required: . Rentals created on this host start in `enforce` and can reach only the allow-list (`updateHostNetwork`). Rentals already running keep their mode.
- `created_at`, string (date-time), required
- `max_cuda_version`, CudaVersion: A CUDA version, `major.minor`. On a host or an offer it is the newest CUDA its NVIDIA driver runs, derived by Legion from `driver_version` and NVIDIA's published driver table. Absent when the driver is unknown or older than CUDA 11.8.
- `score`, LegionScore: The host's Legion score (0-100) and its breakdown. See `getScoreFormula` for the weights and thresholds of `version`.
  - `value`, integer, required
  - `version`, string, required
  - `provisional`, boolean, required: True while Legion has less than the formula's `provisional_days` of the host's history.
  - `computed_at`, string (date-time), required
  - `components`, array of ScoreComponent, required
    - `key`, string, required: `stability`, `freshness`, `performance` or `latency`.
    - `weight`, integer, required: Weight out of 100 across components.
    - `measured`, boolean, required: Whether any of its factors has data. A component without data is left out of the score.
    - `value`, number (double): The component's score. Absent when not measured.
    - `factors`, array of ScoreFactor, required
      - `key`, string, required
      - `weight`, number (double), required: Weight inside the component.
      - `measured`, boolean, required
      - `score`, number (double): Absent when not measured.
      - `verified`, boolean, required: True when Legion computed or observed the value itself; false when the host reported it.
      - `observed`, string: The value the factor was scored on, in words. Absent when not measured.
- `reliability`, HostReliability: What Legion computed about the host's dependability from its own records: never reported by the host. Updated every few minutes.
  - `uptime_30d`, number (double): Share of the minutes the host was online over the last 30 days since tracking began, out of the minutes it was at risk, meaning listed on the market or with an active rental. Minutes offline while unlisted with no active rental are left out. Absent until Legion has seen it sync.
  - `tracked_since`, string (date-time): When Legion started tracking the host's uptime.
  - `rentals_90d`, integer, required: Rentals created on the host in the last 90 days.
  - `failed_90d`, integer, required: Of those, how many failed for a reason on the host's side.
  - `interrupted_90d`, integer, required: Of those, how many lost the host while running.
- `benchmark`, HostBenchmark: One benchmark run of a host as Legion kept it. The agent runs it only while the host has no rental. Bandwidth is in Mbps; disk is sequential, in MB/s. A number with a flag against it is still shown here, for the provider and the admins, but scores 0 and is left out of search. Bandwidth comes in two figures. `edge_download_mbps` and `edge_upload_mbps` are the host's line speed, measured against the nearest Cloudflare location (`edge_location`) and verified with the Worker's signed receipt; `download_mbps` and `upload_mbps` are to the Legion control plane in us-west-2, with `control_plane_rtt_ms`, the round trip the agent saw to it. The score and search use the edge figure when the run has one, the control-plane figure otherwise. A run from an agent without the edge test has only the control-plane figures. `disk_read_mbps` and `disk_write_mbps` are the median of the runs in `disk_read_range` and `disk_write_range` when those are present. On a host (`Host.benchmark`, `Offer.benchmark`) every figure is the newest run that measured it, not the newest run as a whole: a run that skipped the network test does not blank the network figures an earlier run verified, as long as that run is no more than 72 hours old (the newest run's own figures are always shown). `run_id` and `measured_at` are the newest run's; `network_measured_at` says when the network figures were measured. A flag belongs to the run its figure came from, so a newer flagged measurement still replaces an older clean one. In the list of runs (`listHostBenchmarks`) every item is one run as it was, with only what it measured.
  - `run_id`, string (uuid), required
  - `measured_at`, string (date-time), required
  - `network_measured_at`, string (date-time): When the bandwidth figures (`download_mbps`, `upload_mbps`, `edge_download_mbps`, `edge_upload_mbps`) were measured: the newest run that measured any of them. Absent when none is shown, and in the list of runs (listHostBenchmarks), where each item is one run.
  - `network_skipped_reason`, string: Why this run (`run_id`) has no bandwidth figures, or no control-plane or no edge figures; absent when it measured both. `run_interval`: the host already ran a benchmark in the last 6 hours and no new request was made since, so the control plane and the edge refused the transfers. `daily_bytes`: the host used its control-plane transfer budget for the day. `edge_daily_runs`: it used its 4 edge runs for the day. `edge_run_over`: the run was more than 15 minutes old when it asked for an edge token. `edge_unavailable`: the edge test is not configured. `agent_skipped`: nothing was refused and nothing reached Legion, so the agent did not try. New values may be added.
  - `download_mbps`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `upload_mbps`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `control_plane_rtt_ms`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `edge_download_mbps`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `edge_upload_mbps`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `edge_location`, BenchEdgeLocation: Where the edge bandwidth test was served, as Cloudflare places the request.
    - `colo`, string, required: Cloudflare's location code, an IATA airport code such as LHR.
    - `city`, string
    - `country`, string: ISO 3166-1 alpha-2, as Cloudflare reports it.
  - `disk_read_mbps`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `disk_write_mbps`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `disk_read_range`, BenchmarkRange: The slowest and fastest of a disk figure's runs; its median is the figure itself.
    - `min`, number (double), required
    - `max`, number (double), required
    - `runs`, integer: How many runs; absent when the agent did not say.
  - `disk_write_range`, BenchmarkRange: The slowest and fastest of a disk figure's runs; its median is the figure itself.
    - `min`, number (double), required
    - `max`, number (double), required
    - `runs`, integer: How many runs; absent when the agent did not say.
  - `disk_cache_suspected`, boolean, required: The disk reads may include the hypervisor's cache: the agent said so, or the disk is `virtual` and reads more than 3 times faster than it writes. Informational: the figures stand and nothing is flagged. Setting the virtual disk's cache mode to none gives true figures.
  - `disk_randread_iops`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `disk_randwrite_iops`, BenchmarkValue
    - `value`, number (double), required
    - `verified`, boolean, required: True when Legion measured it itself (network bandwidth through its own listener, or through its edge Worker with a signed receipt); false when the host reported it.
  - `latency`, array of RegionLatency, required
    - `region`, LatencyRegion, required: The reference regions agents measure round trips to: TCP connects to each region's public EC2 API endpoint, the median of 5.
    - `rtt_ms`, number (double), required
  - `flags`, array of string, required: What looked wrong: `net_claim_mismatch` (the agent claimed a download more than 20% above what Legion measured; an upload claim never flags), `disk_implausible` (faster sequential throughput than the disk type can have), `disk_iops_implausible` (more random I/O operations per second than the disk type can do), `latency_impossible` (round trips that break the triangle inequality between regions), `location_mismatch` (the declared country is on another continent than the region the host is near), `hw_inconsistent` (a compute capability the GPU model does not have), `edge_claim_mismatch` (the agent claimed more than 20% above the edge bandwidth on the Worker's receipt), `edge_receipt_invalid` (an edge receipt that is not the Worker's, or not for this host and run). A bandwidth flag voids only the direction that mismatched (`claim_mismatches`); the edge upload never flags. A run kept before has no `claim_mismatches`, and its bandwidth flag voids both directions of its group.
  - `claim_mismatches`, array of BenchmarkClaimMismatch: The bandwidth figures the agent claimed more than 20% above what Legion measured, so the provider sees both numbers. `flag` is the flag it raised; absent for `edge_upload`, which is only noted: the edge Worker reads an upload as Cloudflare hands it the body, so its figure can fall well short of the line, and the line upload is then the higher of the edge and control-plane figures.
    - `metric`, string, required: `download` and `upload` are to the control plane, `edge_download` and `edge_upload` to `edge_location`.
    - `claimed_mbps`, number (double), required: What the host's agent measured.
    - `measured_mbps`, number (double), required: What Legion's server or edge Worker measured for the same run.
    - `flag`, string
- `hardware`, HostHardware: What the agent reports about the host beyond its GPUs. Every field is absent until reported.
  - `cpu_model`, string
  - `disk_type`, DiskType: The kind of the workspace disk as the host's agent reports it. `virtual` is a block device a hypervisor presents (virtio, QEMU, VMware, Hyper-V, Xen or a cloud volume): the media behind it is unknown and often NVMe, so its speed is judged against the widest ceiling, not the HDD or SATA SSD one. An agent that predates `virtual` reports `hdd` or `ssd` for such a disk.
  - `disk_free_gib`, integer (int64): Free space on the filesystem that holds rental workspaces.
  - `pcie_gen_max`, integer: The lowest, across the host's GPUs, of the PCIe generation its link can run.
  - `pcie_width_max`, integer: The lowest PCIe link width across the GPUs.
  - `nvlink_links`, integer: Active NVLink links per GPU, the lowest across the GPUs; 0 is no NVLink.
  - `physical_cores`, integer: Physical CPU cores on the host. Absent until an agent that reports it syncs.
  - `threads_per_core`, integer: Hardware threads per physical core. 1 means every vCPU is a dedicated core.
  - `smt_active`, boolean: Whether simultaneous multithreading is on, from the kernel.
- `benchmark_request`, HostBenchmarkRequest: The state of a host's request for a new benchmark run, on the host reads. `state`: `scheduled` (asked, waiting for the host to be idle: no rental, two idle syncs in a row; a run never starts during a rental, and a rental that arrives cancels a run in progress, which is asked for again), `running` (the agent reported a run in progress in the last 2 minutes), `done` (the last request of the provider was fulfilled at `completed_at`); absent when nothing was requested. The request survives agent restarts, rentals and controller deploys: it stays until the runs it asked for arrive. A provider may make `requests_per_day` requests in any rolling 24 hours; `remaining_requests` are left, and when none is, `next_available_at` is when the oldest of the requests in the window leaves it.
  - `state`, string
  - `requested_at`, string (date-time)
  - `completed_at`, string (date-time)
  - `host_busy`, boolean, required: The host serves a rental now, so a scheduled run waits for it.
  - `remaining_requests`, integer, required
  - `requests_per_day`, integer, required
  - `next_available_at`, string (date-time)
  - `message`, string: Plain words for the provider about a scheduled or running request.
- `benchmark_requested_at`, string (date-time): When Legion or the provider last asked the host to benchmark again; absent once the runs it asked for arrived, newer than it: a network run from a `bench_v1` agent and a GPU run from a `bench_v2` agent (any run from an agent that reports neither).
- `gpu_benchmark`, HostGPUBenchmark: One GPU benchmark run of a host as Legion kept it. The Legion agent runs Legion's pinned benchmark image on the provider's machine while the host has no rental: the numbers are measured by the Legion agent (provider-run), never verified by a renter. A run with a flag is still shown here, for the provider and the admins, but is never scored and is left out of search.
  - `run_id`, string (uuid), required
  - `measured_at`, string (date-time), required
  - `tool_version`, string, required
  - `driver_version`, string
  - `cuda_version`, string
  - `tflops`, number (double): Dense FP16/BF16 tensor-core throughput per GPU, in TFLOPS: for each GPU the better of `bf16_tflops` and `fp16_tflops`, then the median across the host's GPUs. Absent when no GPU measured either.
  - `mem_bw_gbps`, number (double): Device memory bandwidth per GPU, in GB/s, the median across the host's GPUs.
  - `spec_tflops`, number (double): NVIDIA's published dense FP16/BF16 tensor peak (FP32 accumulation, no sparsity) for the host's GPU model, from Legion's table. Absent for a model not in it.
  - `gpus`, array of GPUBenchmarkGPU, required
    - `index`, integer, required: The GPU's index as nvidia-smi numbers it.
    - `name`, string: The GPU's name as the driver reports it.
    - `fp16_tflops`, number (double)
    - `bf16_tflops`, number (double)
    - `tf32_tflops`, number (double)
    - `fp32_tflops`, number (double)
    - `mem_bw_gbps`, number (double)
    - `h2d_gbps`, number (double)
    - `d2h_gbps`, number (double)
  - `p2p`, array of GPUPeerBandwidth, required
    - `src`, integer, required
    - `dst`, integer, required
    - `link`, string, required
    - `access`, boolean: Whether the two GPUs have direct peer access (cudaDeviceCanAccessPeer).
    - `gbps`, number (double)
  - `flags`, array of string, required: What looked wrong: `gpu_implausible` (a GPU measured more than 1.15 times its model's published peak, or more than 3 median absolute deviations from what the other hosts with the same model measured).
- `score_tips`, array of ScoreTip: How the provider can raise the host's score, biggest gain first. Absent until the host is scored; empty when there is nothing to improve that the provider controls.
  - `factor`, string, required
  - `gain`, integer, required: Points the score would gain with this factor perfect.
  - `message`, string, required

Example:

```json
{
  "maintenance": {
    "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "host_name": "string",
    "batch_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "state": "scheduled",
    "reason": "hardware",
    "note": "string",
    "start": "2026-10-15T12:00:00Z",
    "planned_end": "2026-10-15T12:00:00Z",
    "ended_at": "2026-10-15T12:00:00Z",
    "end_requested_at": "2026-10-15T12:00:00Z",
    "scheduled_at": "2026-10-15T12:00:00Z",
    "scheduled_by": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "notice_from": "2026-10-15T12:00:00Z",
    "reschedules_left": 0,
    "penalty_free": false,
    "penalty_free_final": false,
    "required_notice_seconds": 0,
    "notice_seconds": 0,
    "earliest_penalty_free_start": "2026-10-15T12:00:00Z",
    "rentals": {
      "on_demand": 0,
      "interruptible": 0
    },
    "may_restart": 0,
    "renters_notified": 0,
    "started_at": "2026-10-15T12:00:00Z",
    "cancelled_at": "2026-10-15T12:00:00Z",
    "cancel_cause": "provider",
    "end_cause": "on_time",
    "overrun_seconds": 0,
    "excused_seconds": 0
  },
  "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
  "org_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
  "own_use_price_per_gpu_hour": {
    "amount_minor": 250,
    "currency": "USD"
  },
  "own_use_fee_bps": 0,
  "own_use_fee_floor_per_gpu_hour": {
    "amount_minor": 250,
    "currency": "USD"
  },
  "renter_fee_bps": 0,
  "renter_price_per_gpu_hour": {
    "amount_minor": 250,
    "currency": "USD"
  },
  "renter_interruptible_price_per_gpu_hour": {
    "amount_minor": 250,
    "currency": "USD"
  },
  "name": "quiet-river-7k2f",
  "hostname": "string",
  "state": "pending",
  "quarantine_reason": "string",
  "credentials_revoked_at": "2026-10-15T12:00:00Z",
  "online": false,
  "last_seen_at": "2026-10-15T12:00:00Z",
  "stale": false,
  "removed_at": "2026-10-15T12:00:00Z",
  "removed_reason": "provider",
  "removal": {
    "requested_at": "2026-10-15T12:00:00Z",
    "stored_data": "when_empty",
    "reason": "provider",
    "waiting": false,
    "deadline": "2026-10-15T12:00:00Z",
    "stored_data_rentals": [
      {
        "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
        "name": "quiet-river-7k2f",
        "state": "starting",
        "estimated_size_bytes": 0,
        "estimate_basis": "disk_used",
        "delete_after": "2026-10-15T12:00:00Z",
        "backup_state": "queued",
        "rented_by_you": false
      }
    ]
  },
  "observed_country": "DE",
  "country_verification": "verified",
  "gpu_model": "NVIDIA H100 80GB HBM3",
  "gpu_class": "h100-sxm",
  "gpu_memory_mib": 0,
  "gpu_count": 0,
  "gpus_free": 0,
  "total": {
    "cpu_cores": 0,
    "memory_mib": 0,
    "disk_gib": 0
  },
  "driver_version": "string",
  "platform": "linux/amd64",
  "compute_capability": "9.0",
  "agent_version": "string",
  "listing": {
    "listed": false,
    "price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "interruptible_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "country": "DE",
    "pricing_mode": "manual",
    "min_price_per_gpu_hour": {
      "amount_minor": 250,
      "currency": "USD"
    },
    "offer_interruptible": false,
    "auto_priced_at": "2026-10-15T12:00:00Z",
    "visibility": "not_listed",
    "first_benchmark_at": "2026-10-15T12:00:00Z"
  },
  "storage_price_per_gib_month": {
    "amount_minor": 250,
    "currency": "USD"
  },
  "provider_share_bps": 9000,
  "runtime": false,
  "offer_hold": {
    "reason": "agent_runtime_abi_below_minimum",
    "min_abi": 1,
    "agent_abi": 0
  },
  "disk_hold": {
    "reason": "string"
  },
  "clock": {
    "offset_ms": 0,
    "ntp_synchronized": false,
    "reported_at": "2026-10-15T12:00:00Z"
  },
  "isolation": {
    "verified": false,
    "required_from": "2026-10-15T12:00:00Z",
    "blocked": false,
    "fix_command": "sudo legion-agent enable-userns",
    "state": "on",
    "failure": "docker_not_remapped",
    "retry_at": "2026-10-15T12:00:00Z"
  },
  "start_hold": {
    "since": "2026-10-15T12:00:00Z",
    "until": "2026-10-15T12:00:00Z",
    "failures": 0,
    "last_reason": "string",
    "message": "string"
  },
  "gpu_memory_outside_legion": [
    {
      "index": 0,
      "memory_mib": 0,
      "foreign_memory_mib": 0,
      "offered": false
    }
  ],
  "blocked_cidrs": [
    "string"
  ],
  "require_allowlist": false,
  "created_at": "2026-10-15T12:00:00Z",
  "max_cuda_version": "12.8",
  "score": {
    "value": 0,
    "version": "v1",
    "provisional": false,
    "computed_at": "2026-10-15T12:00:00Z",
    "components": [
      {
        "key": "string",
        "weight": 0,
        "measured": false,
        "value": 0,
        "factors": [
          {
            "key": "string",
            "weight": 0,
            "measured": false,
            "score": 0,
            "verified": false,
            "observed": "string"
          }
        ]
      }
    ]
  },
  "reliability": {
    "uptime_30d": 0,
    "tracked_since": "2026-10-15T12:00:00Z",
    "rentals_90d": 0,
    "failed_90d": 0,
    "interrupted_90d": 0
  },
  "benchmark": {
    "run_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "measured_at": "2026-10-15T12:00:00Z",
    "network_measured_at": "2026-10-15T12:00:00Z",
    "network_skipped_reason": "string",
    "download_mbps": {
      "value": 0,
      "verified": false
    },
    "upload_mbps": {
      "value": 0,
      "verified": false
    },
    "control_plane_rtt_ms": {
      "value": 0,
      "verified": false
    },
    "edge_download_mbps": {
      "value": 0,
      "verified": false
    },
    "edge_upload_mbps": {
      "value": 0,
      "verified": false
    },
    "edge_location": {
      "colo": "string",
      "city": "string",
      "country": "string"
    },
    "disk_read_mbps": {
      "value": 0,
      "verified": false
    },
    "disk_write_mbps": {
      "value": 0,
      "verified": false
    },
    "disk_read_range": {
      "min": 0,
      "max": 0,
      "runs": 1
    },
    "disk_write_range": {
      "min": 0,
      "max": 0,
      "runs": 1
    },
    "disk_cache_suspected": false,
    "disk_randread_iops": {
      "value": 0,
      "verified": false
    },
    "disk_randwrite_iops": {
      "value": 0,
      "verified": false
    },
    "latency": [
      {
        "region": "us-west-2",
        "rtt_ms": 0
      }
    ],
    "flags": [
      "string"
    ],
    "claim_mismatches": [
      {
        "metric": "download",
        "claimed_mbps": 0,
        "measured_mbps": 0,
        "flag": "string"
      }
    ]
  },
  "hardware": {
    "cpu_model": "string",
    "disk_type": "nvme",
    "disk_free_gib": 0,
    "pcie_gen_max": 1,
    "pcie_width_max": 1,
    "nvlink_links": 0,
    "physical_cores": 1,
    "threads_per_core": 1,
    "smt_active": false
  },
  "benchmark_request": {
    "state": "scheduled",
    "requested_at": "2026-10-15T12:00:00Z",
    "completed_at": "2026-10-15T12:00:00Z",
    "host_busy": false,
    "remaining_requests": 0,
    "requests_per_day": 1,
    "next_available_at": "2026-10-15T12:00:00Z",
    "message": "string"
  },
  "benchmark_requested_at": "2026-10-15T12:00:00Z",
  "gpu_benchmark": {
    "run_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "measured_at": "2026-10-15T12:00:00Z",
    "tool_version": "string",
    "driver_version": "string",
    "cuda_version": "string",
    "tflops": 0,
    "mem_bw_gbps": 0,
    "spec_tflops": 0,
    "gpus": [
      {
        "index": 0,
        "name": "string",
        "fp16_tflops": 0,
        "bf16_tflops": 0,
        "tf32_tflops": 0,
        "fp32_tflops": 0,
        "mem_bw_gbps": 0,
        "h2d_gbps": 0,
        "d2h_gbps": 0
      }
    ],
    "p2p": [
      {
        "src": 0,
        "dst": 0,
        "link": "nvlink",
        "access": false,
        "gbps": 0
      }
    ],
    "flags": [
      "string"
    ]
  },
  "score_tips": [
    {
      "factor": "string",
      "gain": 1,
      "message": "string"
    }
  ]
}
```

### 400

The request is malformed, or a range is not a valid IPv4 CIDR in canonical form, is wider
than /8, or the list is longer than 32 (`invalid_cidr`).

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

### 409

`require_allowlist` is true and the host's agent does not advertise `egress_enforce_v1`
(`enforce_unavailable`). Nothing is changed.

### 500

An unexpected server error. Safe to retry.

## Errors

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

## Example request

```sh
curl -s -X PUT "https://api.legion.ambient.xyz/v1/hosts/$HOST_ID/network" \
  -H "Authorization: Bearer $LEGION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "blocked_cidrs": [
    "192.0.2.0/25"
  ],
  "require_allowlist": false
}'
```
