Rate limits
What a 429 means, how long to wait, and which operations have limits.
Some operations limit how often your organization, or you, can call them. Over a limit, the API answers 429 Too Many Requests.
What a 429 looks like
codeisrate_.limited The
Retry-Afterheader says how many seconds to wait.
inspectImage and createRental can also answer 429 mirror_: your organization asked Legion to copy in too many different tags or digests of one image repository today. Use a tag you've used before, or wait until tomorrow (UTC).
What to do
Wait at least
Retry-Afterseconds, then try again.For an operation that takes an
Idempotency-Key, retry with the same key. See Idempotency.Don't retry in a tight loop. Add jitter if several workers share a key.
Operations with limits
These operations can answer 429. Each one's reference page says what its limit is.
Rent GPUs on a host
POST /v1/ rentals Change a rental's settings
PATCH /v1/ rentals/ {rental_ id} Delete a rental and its workspace
DELETE /v1/ rentals/ {rental_ id} What the rental's network blocked or would have blocked in the last 24 hours
GET /v1/ rentals/ {rental_ id}/ network/ activity Read a rental's logs
GET /v1/ rentals/ {rental_ id}/ logs Stop a rental
POST /v1/ rentals/ {rental_ id}/ stop Export a stopped rental's workspace
POST /v1/ rentals/ {rental_ id}/ workspace-exports Back up a stopped or failed rental's workspace
POST /v1/ rentals/ {rental_ id}/ backups Mint a download link for a ready backup
POST /v1/ backups/ {backup_ id}/ download-links Create a service
POST /v1/ services Create a service key
POST /v1/ services/ {service_ id}/ keys Rotate a service key
POST /v1/ services/ {service_ id}/ keys/ {key_ id}/ rotate Read a service's logs, every replica
GET /v1/ services/ {service_ id}/ logs Inspect a container image before renting it
POST /v1/ images/ inspect Save the organization's sign-in for a registry
PUT /v1/ registry-sign-ins/ {registry} Save a registry credential
POST /v1/ registry-credentials Rename a registry credential or replace its secret
PATCH /v1/ registry-credentials/ {credential_ id} Top up the organization's balance
POST /v1/ billing/ top-ups Turn auto top-up on or off and set its amounts
PUT /v1/ billing/ auto-top-up Save or replace the card auto top-up charges
POST /v1/ billing/ auto-top-up/ card Refund unused credit to the cards and bank accounts it came from
POST /v1/ billing/ credit-refunds Check what a promo code gives the organization
POST /v1/ billing/ promo-codes/ preview Redeem a promo code
POST /v1/ billing/ promo-codes/ redeem Ask for a destination to be added to the allow-list
POST /v1/ egress-requests Schedule maintenance on one or many hosts
POST /v1/ maintenance-windows Move or change scheduled maintenance windows
POST /v1/ maintenance-windows/ reschedule Cancel scheduled maintenance windows
POST /v1/ maintenance-windows/ cancel End active maintenance windows now ("done with maintenance")
POST /v1/ maintenance-windows/ end Ask your host to benchmark again
POST /v1/ hosts/ {host_ id}/ benchmark-request A host's network state and the abuse flags raised on its rentals
GET /v1/ hosts/ {host_ id}/ network Invite a person to the organization
POST /v1/ invitations Email an invitation again
POST /v1/ invitations/ {invitation_ id}/ resend What GPUs can be rented now, and from what price (public)
GET /api/ public/ market