Errors
How the API reports errors, what each field means, and every error code.
Errors use RFC 9457 (opens in a new tab) problem details, with the content type application/.
An example
A request with a cursor the API didn't issue gets status 400, an X-Request-Id header, and this body (abridged):
{
"status": 400,
"code": "invalid_cursor",
"title": "Bad Request",
"detail": "The cursor is not one this API returned.",
"instance": "/v1/rentals"
}The fields
| Field | What it is |
|---|---|
code | A stable, machine-readable code. Branch on this. |
status | The HTTP status. |
title | A short summary for people. It can change. |
detail | An explanation for people. It can change. |
type | A URI for the code. |
instance | The request path. |
resource_ | The resource a conflict refers to, when there is one. |
Some problems carry more. For example, 403 terms_ includes legal, the documents to accept.
Handle errors
Branch on
code, never ontitleordetail.Treat a code you don't know by its HTTP status.
On
429, wait forRetry-Afterseconds. See Rate limits.On a
5xx, retry with backoff. For operations that take anIdempotency-Key, retry with the same key. See Idempotency.Log the
X-Request-Idheader, and quote it when you contact support.
A resource that belongs to another organization answers 404 not_, the same as one that doesn't exist.
Codes
Every error code
The codes the API reference names, with the operations that return each one.
auto_backup_not_applicable
400Returned by Rent GPUs on a host, Change a rental's settings.
auto_pricing_on
400Returned by Set a host's price and availability.
auto_resume_not_applicable
400Returned by Change a rental's settings.
bid_not_applicable
400Returned by Change a rental's settings.
confirmation_mismatch
400Returned by Remove a host.
denied_range
400Returned by Ask for a destination to be added to the allow-list.
env_reserved
400Returned by Rent GPUs on a host, Change a rental's settings, Create a service, Estimate what a service would cost, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
host_visibility_not_acknowledged
400Returned by Create a service.
image_outside_prefix
400Returned by Save a registry credential, Rename a registry credential or replace its secret.
image_private
400422Returned by Rent GPUs on a host, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Inspect a container image before renting it.
image_registry_mismatch
400Returned by Save the organization's sign-in for a registry.
interruption_behavior_not_allowed
400Returned by Rent GPUs on a host.
invalid_cidr
400Returned by Set the destinations blocked for rentals on a host.
invalid_command
400Returned by Rent GPUs on a host, Change a rental's settings, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_country
400Returned by Set a host's price and availability.
invalid_cursor
400Returned by List the organization's rentals, Read a rental's logs, A rental's backups, newest first, The organization's backups, newest first, Read a service's logs, every replica, List the organization's ledger entries, List what happened to the organization's balance or earnings, List the organization's top-ups, List the organization's promo code redemptions, The organization's maintenance windows, A host's listing price history, newest first, List the caller's API keys, List the organization's members.
invalid_env
400Returned by Rent GPUs on a host, Change a rental's settings, Create a service, Estimate what a service would cost, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_hardware
400Returned by Create a service, Estimate what a service would cost, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_image_reference
400Returned by Rent GPUs on a host, Inspect a container image before renting it, Save the organization's sign-in for a registry, Save a registry credential, Split an image reference into registry host and path prefix, Rename a registry credential or replace its secret.
invalid_interruptible_price
400Returned by Set a host's price and availability.
invalid_label
400Returned by Save an SSH public key.
invalid_listing
400Returned by Set a host's price and availability.
invalid_logs_query
400Returned by Read a rental's logs, Read a service's logs, every replica.
invalid_maintenance_window
400Returned by Schedule maintenance on one or many hosts, What scheduling maintenance would do, Move or change scheduled maintenance windows.
invalid_min_price
400Returned by Set a host's price and availability.
invalid_model_setting
400Returned by Rent GPUs on a host, Change a rental's settings, Create a service, Estimate what a service would cost, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_name
400Returned by Rename a host.
invalid_path_prefix
400Returned by Save a registry credential.
invalid_pattern
400Returned by Ask for a destination to be added to the allow-list.
invalid_range
400Returned by The organization's earnings over a period, with the previous period, The organization's earnings over time, The organization's earnings by one dimension, What each of the organization's hosts earned and how it performed, One host's earnings, utilization, uptime and price against the market, The rentals on the organization's hosts that were billed in a period, Hosts that are earning less than they could, with what to do, What is payable, when the next payout runs and the history of payouts, The organization's spend over a period, with the previous period, The organization's spend over time, The organization's spend by one dimension, The organization's rentals that were charged in a period.
invalid_registry_credential
400Returned by Save a registry credential, Rename a registry credential or replace its secret.
invalid_request
400Any operation can answer it.
invalid_scaling
400Returned by Create a service, Estimate what a service would cost, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_serve
400Returned by Rent GPUs on a host, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_service_name
400Returned by Create a service.
invalid_sign_in
400Returned by Save the organization's sign-in for a registry.
invalid_source
400Returned by Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_spend_cap
400Returned by Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invalid_ssh_key
400Returned by Rent GPUs on a host, Change a rental's settings, Save an SSH public key.
max_above_on_demand
400Returned by Rent GPUs on a host, Change a rental's settings.
not_a_member
400Returned by Change whether a notification is emailed, and to whom.
override_not_allowed
400Returned by Rent GPUs on a host, Change a rental's settings, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
pattern_too_broad
400Returned by Ask for a destination to be added to the allow-list.
price_required
400Returned by Set a host's price and availability.
private_key_refused
400Returned by Rent GPUs on a host, Change a rental's settings, Save an SSH public key.
registry_sign_in_rejected
400422Returned by Rent GPUs on a host, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Inspect a container image before renting it, Save the organization's sign-in for a registry.
resume_after_maintenance_not_applicable
400Returned by Change a rental's settings.
selected_members_required
400Returned by Change whether a notification is emailed, and to whom.
service_kind_unsupported
400Returned by Create a service.
insufficient_credit
402Returned by Rent GPUs on a host, Delete a rental and its workspace, Stop a rental, Make a single-use download link for a ready workspace export, Back up a stopped or failed rental's workspace, Mint a download link for a ready backup, Create a service.
access_not_approved
403Any operation can answer it.
account_conflict
403Any operation can answer it.
api_key_required
403Any operation can answer it.
api_key_scope
403Any operation can answer it.
catalog_entry_disabled
403Returned by Rent GPUs on a host.
custom_images_disabled
403Returned by Rent GPUs on a host, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
domain_not_allowed
403Any operation can answer it.
email_unverified
403Any operation can answer it.
forbidden
403Any operation can answer it.
no_organization
403Returned by Search GPU offers, Get one offer with its score breakdown and uptime history, List the caller's offer alerts, Be emailed once when a matching machine is available, Get one offer alert, Rename, re-arm or change the expiry of an offer alert, Delete an offer alert, How the Legion score is computed, List the organization's rentals, Rent GPUs on a host, Get a rental, Change a rental's settings, Delete a rental and its workspace, How to reach the model a rental serves, Create the rental's model service if it has none, The rental's effective network policy and whether its host applied it, The host a rental runs on, its health and its GPUs' live telemetry, What the rental's network blocked or would have blocked in the last 24 hours, Read a rental's logs, Stop a rental, Restart a stopped rental, List a rental's recent workspace exports, Export a stopped rental's workspace, Get a workspace export, Cancel a pending workspace export, What downloading a rental's workspace export will cost, Make a single-use download link for a ready workspace export, How long a stopped rental's files are kept, and what backups cost, Data this rental sent out through Legion's relays, and what it cost, The organization's relay traffic this month, its free allowance and the rentals that used most, What a backup of this rental would cost, A rental's backups, newest first, Back up a stopped or failed rental's workspace, The organization's backups, newest first, Get a backup, Delete a ready backup early, Cancel a queued or uploading backup, Mint a download link for a ready backup, List the organization's services, Create a service, The defaults of a new service, Estimate what a service would cost, Get a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Delete a service, Pause a service, Resume a paused service, List a service's keys, Create a service key, Revoke a service key, Rotate a service key, List a service's replicas, A service's metrics and cost, A service's inference metrics, A service's activity, Read a service's logs, every replica, Which catalog entries Legion has hidden or disabled, and whether custom images are allowed, List Legion's starter images and premade models, and which a host can run, Inspect a container image before renting it, The organization's registry sign-ins, Save the organization's sign-in for a registry, Remove the organization's sign-in for a registry, The organization's registry credentials, Save a registry credential, Split an image reference into registry host and path prefix, One registry credential, Rename a registry credential or replace its secret, Remove a registry credential, Get what a rental has cost, Get the organization's balance, List the organization's ledger entries, List what happened to the organization's balance or earnings, List what the organization's rentals have cost, Get the organization's provider earnings, Get what a rental on one of the organization's hosts has earned, The organization's earnings over a period, with the previous period, The organization's earnings over time, The organization's earnings by one dimension, What each of the organization's hosts earned and how it performed, One host's earnings, utilization, uptime and price against the market, The rentals on the organization's hosts that were billed in a period, Hosts that are earning less than they could, with what to do, What is payable, when the next payout runs and the history of payouts, The organization's spend over a period, with the previous period, The organization's spend over time, The organization's spend by one dimension, The organization's rentals that were charged in a period, Get the organization's payout setup, List the organization's top-ups, Top up the organization's balance, See the organization's auto top-up, Turn auto top-up on or off and set its amounts, Save or replace the card auto top-up charges, Remove the saved card and turn auto top-up off, See how much unused credit can be refunded, and the fee kept, Refund unused credit to the cards and bank accounts it came from, Check what a promo code gives the organization, Redeem a promo code, List the organization's promo code redemptions, Get the organization's promo credit and discounts, The organization's outbound allow-list, Hold the organization's new rentals to the allow-list, The organization's egress requests, Ask for a destination to be added to the allow-list, Withdraw a pending egress request, List pending enrollment tokens, Create a host enrollment token, Revoke an enrollment token, List the organization's hosts, Get a host, Remove a host, The organization's maintenance windows, Schedule maintenance on one or many hosts, What scheduling maintenance would do, Move or change scheduled maintenance windows, Cancel scheduled maintenance windows, End active maintenance windows now ("done with maintenance"), Preview what is on a host before removing it, Rename a host, Set a host's price and availability, A host's benchmark runs, newest first, Progress of a host's first benchmark, Ask your host to benchmark again, Take your host off its start-failure pause, A host's GPU benchmark runs, newest first, A host's listing price history, newest first, What Legion recommends the host charge per GPU-hour, A host's network state and the abuse flags raised on its rentals, Set the destinations blocked for rentals on a host, Get the caller, List the caller's API keys, Create an API key, Revoke an API key, List the caller's saved SSH public keys, Save an SSH public key, Delete a saved SSH public key, List pending invitations, Invite a person to the organization, Revoke a pending invitation, Email an invitation again, List the organization's members, List the organization's notifications, Mark every notification read, Mark a notification read, Which notifications are emailed, and to whom, Change whether a notification is emailed, and to whom.
not_a_provider
403Returned by Get the organization's payout setup.
oauth_token_mcp_only
403Any operation can answer it.
org_suspended
403Any operation can answer it.
owner_required
403Returned by Change whether a notification is emailed, and to whom.
promo_code_not_eligible
403Returned by Top up the organization's balance, Redeem a promo code.
requests_disabled
403Returned by Ask for a destination to be added to the allow-list.
session_required
403Any operation can answer it.
step_up_required
403Returned by Create a service, Delete a service, Create a service key, Rotate a service key.
terminal_access_forbidden
403Returned by Change a rental's settings, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
terms_not_accepted
403Any operation can answer it.
web_app_required
403Returned by Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Delete a service, Pause a service, Resume a paused service, Create a service key, Revoke a service key, Rotate a service key.
host_not_offered
404Returned by Rent GPUs on a host.
not_found
404Any operation can answer it.
promo_code_not_found
404Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
replica_not_found
404Returned by A service's inference metrics, Read a service's logs, every replica.
serve_not_configured
404Returned by How to reach the model a rental serves, Create the rental's model service if it has none.
method_not_allowed
405Returned by What GPUs can be rented now, and from what price (public).
alert_limit_reached
409Returned by Be emailed once when a matching machine is available, Rename, re-arm or change the expiry of an offer alert.
alert_not_active
409Returned by Rename, re-arm or change the expiry of an offer alert.
already_member
409Returned by Invite a person to the organization, Email an invitation again.
auto_pricing_disabled
409Returned by Set a host's price and availability.
backup_in_progress
409Returned by Delete a rental and its workspace, Restart a stopped rental, Back up a stopped or failed rental's workspace.
backup_not_cancellable
409Returned by Cancel a queued or uploading backup.
backup_not_ready
409Returned by Delete a ready backup early, Mint a download link for a ready backup.
backup_too_slow
409Returned by Back up a stopped or failed rental's workspace.
bid_below_floor
409Returned by Change a rental's settings.
bid_cancelled
409Returned by Change a rental's settings.
bid_too_low
409Returned by Rent GPUs on a host, Change a rental's settings.
catalog_entry_incompatible
409Returned by Rent GPUs on a host.
egress_already_allowed
409Returned by Ask for a destination to be added to the allow-list.
egress_mode_set_by_admin
409Returned by Hold the organization's new rentals to the allow-list.
egress_request_exists
409Returned by Ask for a destination to be added to the allow-list.
egress_request_not_pending
409Returned by Withdraw a pending egress request.
exceeds_refundable
409Returned by See how much unused credit can be refunded, and the fee kept, Refund unused credit to the cards and bank accounts it came from.
export_in_progress
409Returned by Delete a rental and its workspace, Restart a stopped rental, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace.
export_not_cancellable
409Returned by Cancel a pending workspace export.
export_not_ready
409Returned by Make a single-use download link for a ready workspace export.
floor_cooldown
409Returned by Set a host's price and availability.
host_disk_full
409Returned by Rent GPUs on a host, Restart a stopped rental.
host_has_active_rentals
409Returned by Remove a host.
host_has_stored_data
409Returned by Remove a host.
host_maintenance
409Returned by Rent GPUs on a host, Restart a stopped rental.
host_offline
409Returned by Delete a rental and its workspace, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace.
host_removed
409Returned by Rename a host, Set a host's price and availability.
host_removing
409Returned by Set a host's price and availability.
host_start_hold
409Returned by Rent GPUs on a host.
host_unsupported
409Returned by Rent GPUs on a host, Change a rental's settings, Delete a rental and its workspace, Stop a rental, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace, Create a service.
interruptible_has_bids
409Returned by Set a host's price and availability.
invalid_mode_switch
409Returned by Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
invitation_exists
409Returned by Invite a person to the organization.
invitation_not_pending
409Returned by Email an invitation again.
key_revoked
409Returned by Rotate a service key.
linked_host
409Returned by Rent GPUs on a host, Restart a stopped rental.
model_settings_do_not_fit
409Returned by Change a rental's settings.
name_taken
409Returned by Rename a host.
no_matching_offers
409Returned by Create a service.
no_recommendation
409Returned by Set a host's price and availability.
no_saved_card
409Returned by Turn auto top-up on or off and set its amounts.
notice_open
409Returned by Change a rental's settings.
own_host
409Returned by Rent GPUs on a host, Change a rental's settings, Restart a stopped rental.
price_changed
409Returned by Rent GPUs on a host.
promo_budget_reached
409Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
promo_code_already_redeemed
409Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
promo_code_expired
409Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
promo_code_not_started
409Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
promo_code_used_up
409Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
promo_code_wrong_kind
409Returned by Top up the organization's balance, Redeem a promo code.
promotions_paused
409Returned by Top up the organization's balance, Check what a promo code gives the organization, Redeem a promo code.
refund_quote_changed
409Returned by Refund unused credit to the cards and bank accounts it came from.
registry_credential_exists
409Returned by Save a registry credential.
registry_credential_in_use
409Returned by Remove the organization's sign-in for a registry, Remove a registry credential.
registry_credential_limit
409Returned by Save a registry credential.
registry_sign_in_in_use
409Returned by Remove the organization's sign-in for a registry.
rental_deleted
409Returned by Change a rental's settings.
rental_deleting
409Returned by Change a rental's settings.
rental_failed
409Returned by Change a rental's settings.
rental_held
409Returned by Delete a rental and its workspace, Stop a rental, Restart a stopped rental, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace.
rental_managed_by_service
409Returned by Change a rental's settings, Delete a rental and its workspace, How to reach the model a rental serves, Create the rental's model service if it has none, Stop a rental, Restart a stopped rental, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace.
rental_not_live
409Returned by Create a service, Ask for a destination to be added to the allow-list.
rental_not_stopped
409Returned by Delete a rental and its workspace, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace.
rental_unnamed
409Returned by Create a service.
rentals_running
409Returned by Refund unused credit to the cards and bank accounts it came from.
replica_limit_exceeded
409Returned by Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
revision_mismatch
409Returned by Change a service's model, hardware, scaling or budget, or switch autoscaling on or off.
rule_exists
409Returned by Create a service.
service_capped
409Returned by Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Resume a paused service.
service_deleting
409Returned by Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Pause a service, Resume a paused service, Create a service key, Rotate a service key.
service_disabled
409Returned by Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Resume a paused service.
service_name_taken
409Returned by Create a service.
service_not_autoscaled
409Returned by Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Pause a service, Resume a paused service.
ssh_key_exists
409Returned by Save an SSH public key.
ssh_key_limit
409Returned by Save an SSH public key.
test_org_live_payment
409Returned by Top up the organization's balance, Turn auto top-up on or off and set its amounts, Save or replace the card auto top-up charges.
test_org_no_refunds
409Returned by See how much unused credit can be refunded, and the fee kept, Refund unused credit to the cards and bank accounts it came from.
too_many_keys
409Returned by Create a service key, Rotate a service key.
too_many_rules
409Returned by Create a service.
too_many_services
409Returned by Create a service.
link_used
410Returned by Make a single-use download link for a ready workspace export, Mint a download link for a ready backup.
request_too_large
413Any operation can answer it.
idempotency_key_reused
422Returned by Rent GPUs on a host, Back up a stopped or failed rental's workspace, Create a service, Create a service key, Top up the organization's balance, Turn auto top-up on or off and set its amounts, Refund unused credit to the cards and bank accounts it came from, Redeem a promo code, Ask for a destination to be added to the allow-list, Schedule maintenance on one or many hosts.
image_manifest_unsupported
422Returned by Inspect a container image before renting it, Save the organization's sign-in for a registry, Save a registry credential, Rename a registry credential or replace its secret.
image_not_allowed
422Returned by Rent GPUs on a host, Inspect a container image before renting it.
image_not_found
422Returned by Rent GPUs on a host, Inspect a container image before renting it, Save the organization's sign-in for a registry, Save a registry credential, Rename a registry credential or replace its secret.
image_platform_unsupported
422Returned by Rent GPUs on a host, Inspect a container image before renting it.
image_registry_not_allowed
422Returned by Inspect a container image before renting it.
image_too_large
422Returned by Rent GPUs on a host, Inspect a container image before renting it.
maintenance_note_too_long
422Returned by Schedule maintenance on one or many hosts, Move or change scheduled maintenance windows.
registry_auth_unsupported
422Returned by Save a registry credential, Rename a registry credential or replace its secret.
registry_credential_host_mismatch
422Returned by Rent GPUs on a host, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Inspect a container image before renting it.
registry_credential_not_found
422Returned by Rent GPUs on a host, Create a service, Change a service's model, hardware, scaling or budget, or switch autoscaling on or off, Inspect a container image before renting it.
registry_credential_rejected
422Returned by Save a registry credential, Rename a registry credential or replace its secret.
registry_ecr_unsupported
422Returned by Save a registry credential.
registry_host_not_allowed
422Returned by Save a registry credential, Rename a registry credential or replace its secret.
registry_not_supported
422Returned by Rent GPUs on a host, Inspect a container image before renting it.
registry_realm_not_allowed
422Returned by Save a registry credential, Rename a registry credential or replace its secret.
benchmark_request_limited
429Returned by Ask your host to benchmark again.
bid_rate_limited
429Returned by Rent GPUs on a host.
limit_rate_limited
429Returned by Change a rental's settings.
mirror_quota_exceeded
429Returned by Rent GPUs on a host, Inspect a container image before renting it.
rate_limited
429Returned by Rent GPUs on a host, Delete a rental and its workspace, What the rental's network blocked or would have blocked in the last 24 hours, Read a rental's logs, Stop a rental, Export a stopped rental's workspace, Back up a stopped or failed rental's workspace, Mint a download link for a ready backup, Create a service, Create a service key, Rotate a service key, Read a service's logs, every replica, Inspect a container image before renting it, Save the organization's sign-in for a registry, Save a registry credential, Rename a registry credential or replace its secret, Top up the organization's balance, Turn auto top-up on or off and set its amounts, Save or replace the card auto top-up charges, Refund unused credit to the cards and bank accounts it came from, Check what a promo code gives the organization, Redeem a promo code, Ask for a destination to be added to the allow-list, Schedule maintenance on one or many hosts, Move or change scheduled maintenance windows, Cancel scheduled maintenance windows, End active maintenance windows now ("done with maintenance"), A host's network state and the abuse flags raised on its rentals, Invite a person to the organization, Email an invitation again, What GPUs can be rented now, and from what price (public).
internal
500Any operation can answer it.
logs_upstream_error
502Returned by Read a rental's logs, Read a service's logs, every replica.
benchmark_request_disabled
503Returned by Ask your host to benchmark again.
offer_alerts_disabled
503Returned by Be emailed once when a matching machine is available, Rename, re-arm or change the expiry of an offer alert.