Skip to content

API reference

Every operation of the Legion API you can call with an API key, and the public market API, by area.

Base URL https://api.legion.ambient.xyz/v1. The whole API as OpenAPI: openapi.json · openapi.yaml.

Offers

Search the market's GPU offers, read one host's offer, and the score formula.

Rentals

Rent GPUs, then list, stop, start and delete rentals, back them up and read their network.

Services

Public URLs for what you run on Legion, on a port of a rental or autoscaled on rented GPUs: create, change, pause and delete them, manage their keys, and read their replicas, usage and activity.

Images

Check a container image in its registry before you rent with it.

Billing

Your organization's balance, ledger, charges, top-ups, auto top-up and promo codes, and a provider's earnings and payouts.

Network

Your organization's outbound allow-list, and requests to add a site to it.

Hosts

The hosts you provide: enrollment tokens, listings, names, benchmarks, network and removal.

Identity and keys

Who a key acts as, API keys, saved SSH public keys and your organization's invitations.

Notifications

What the bell shows, marking it read, and which events your organization is emailed about and to whom.

The current versions of Legion's legal documents.

Public market

An anonymous, cached summary of what can be rented now. No key needed.