Skip to content

Stopping, backups and how long your data is kept

What happens to your GPUs and files when you stop or delete a rental, how long Legion keeps the files, how backups work and what they cost, and why a rental's data was deleted.

On this page

A stopped rental gives its GPUs back to the market and keeps its files on the host for a limited time: at least 24 hours, at most 72 hours. To keep files longer, back them up. This page is the single source for how long your data is kept, what a backup costs, and why data was deleted.

At a glance

At a glance
YouGPUsFiles on the hostBilled
Stop a rentalReleased at once. Anyone can rent them.Kept at least 24 hours, at most 72 hours.Storage, while the files are there.
Delete a rentalReleased at once.Deleted at once.Nothing more.
Back up a stopped or failed rentalNot used.Copied: /workspace is kept for 7 or 30 days, apart from the host.The backup's price, once.

Stopping a rental

Stop rental ends GPU billing and gives the GPUs back to the market straight away. Another renter can rent them a moment later. Your files stay on the same host. Nothing is moved.

How long your files stay

The clock starts when the stop completes. For a rental that was already stopped on 23 October 2026, when these rules took effect, the 24 and 72 hours count from that date.

How long your files stay
Time since the stopYour files
0 to 24 hoursKept for you. They stay on the host and are never deleted to make room for anyone.
24 to 72 hoursReclaimable. They stay unless a new rental on that host needs the disk. Then Legion may delete them, without a warning. See Reclaim.
At 72 hoursDeleted, unless you started the rental again. You get a warning email 12 hours before.

Keeping files on the host is best effort: the host is a provider's machine, and it can fail or leave Legion. Don't rely on it as your only copy.

The 72 hours run whether or not your organization has credit, and while it is suspended. A failed rental's files are deleted 72 hours after it failed. If the host leaves Legion, its rentals' files go with it. A rental on a preservation hold is not deleted while it is held; its 72 hours count from when the hold ends.

The rental's page has a Files on this host section: when the files will be deleted, with a countdown, and whether they can be reclaimed now. Through the API, a stopped Rental has:

  • delete_after: when the files will be deleted;

  • data_protected_until: the end of the first 24 hours;

  • data_reclaimable: whether the files can be reclaimed right now;

  • data_status: on_host, deleting or deleted.

getStoragePolicy returns the hours, retention days and prices on this page, from the one place Legion keeps them.

The same clock applies however the rental stopped: you stopped it, your credit ran out, or an interruptible rental set to Keep my data was preempted or outbid. A preempted rental that starts again by itself before the deadline keeps its files, and Legion's agent deletes the preemption.json notice file when it starts. One that hasn't started by then loses them. Its price on the way back depends on why it stopped: after an on-demand preemption it keeps its price; after winning an auction clearing again it can be a different price, between the floor and your max.

Reclaim

From 24 hours after the stop, the disk your files use can be given to another renter. When someone creates or starts a rental on that host and the host is short of disk, Legion deletes stopped rentals' files to make room:

  • only files past their first 24 hours;

  • never files with a backup or workspace download being made, or on a preservation hold;

  • the oldest stop first, and as few rentals as cover what's missing.

The new rental waits until the host confirms the files are gone. Only a person creating or starting a rental reclaims disk: a rental that starts again by itself never does. A reclaimed rental shows the reason on its page, and you get an email. Legion doesn't warn before a reclaim, so back up within 24 hours if the files matter.

What storage costs

While the files are on the host, the rental is billed for the disk it uses, per GiB per month of 730 hours, by the second. The default rate is $0.20 per GiB per 730-hour month. The rent form and the rental's Cost tab show the rate that applies.

Text
storage per month = GiB used × rate
storage per hour  = GiB used × rate ÷ 730
  • GiB used is the disk the rental uses on the host, at most its share of the host's disk (resources.disk_gib).

  • Storage is billed only while your organization has credit, and pauses while it is suspended.

  • Billing stops the moment Legion decides to delete the files, for any reason.

  • GPU time isn't billed while the rental is stopped.

Example. A rental with a 250 GiB disk share has used 40 GiB. Stopped, it costs:

Text
40 GiB × $0.20 = $8.00 per month
$8.00 ÷ 730    = about $0.011 per hour

Kept on the host for the full 72 hours, that comes to about $0.79.

An interruptible rental set to Delete it never stops with data, so it never has a storage charge.

Starting again

Start rental runs the rental again on its host, while its files are still there. It needs:

  • The same host's GPUs. If other rentals took them, starting fails with gpus_unavailable. An interruptible rental starts on free GPUs only.

  • The whole disk share free. If other rentals took it, starting fails with host_disk_full.

  • Credit. With no credit, starting is refused with insufficient_credit.

  • No backup or download being made. Starting fails with backup_in_progress or export_in_progress until it ends.

Once the files are deleted, the rental can't be started again. Rent a new one and restore from your backup.

How not to lose data

  • Back up as you stop. The stop dialog asks first what happens to the files: Stop without a backup (chosen unless the rental backs up automatically) or Back up and stop. The retention and the price show once you choose the backup.

  • Back up within 24 hours of an unplanned stop, such as a preemption. After 24 hours, the files can be reclaimed at any moment. Or turn on automatic backup for an interruptible rental, and Legion does it for you.

  • Keep your own copies of anything you can't lose, for example by copying it off over SSH. See Connecting.

Deleting a rental

Delete rental removes the container and its files from the host at once. Deleted files can't be recovered from the host.

The delete dialog offers two ways, and preselects the backup when the rental backs up automatically:

  • Back up first, then delete, for a stopped or failed rental. The delete dialog asks first: Delete without a backup (you type the rental's short ID to confirm) or Back up first, then delete (no ID to type). With the backup, Legion makes a backup, and deletes the rental once the backup is ready. If the backup fails or is cancelled, nothing is deleted and the rental keeps its normal deadline. You get an email if it fails.

A rental can't be deleted while a backup or workspace download of it is being made (409 backup_in_progress or 409 export_in_progress). Cancel it, or wait for it to end.

Backups

A backup is a .tar copy of a rental's /workspace, stored by Ambient apart from the host. It outlives the rental: you can download it after the rental is deleted. Only /workspace is backed up, not the rest of the container.

Make a backup

You can back up a stopped or failed rental:

  • Back up and stop, in the stop dialog: the rental stops at once, and the backup starts as soon as it has stopped.

  • Back up first, then delete, in the delete dialog.

  • Back up now, on a stopped or failed rental's page. One click opens the dialog with the default retention already chosen; one more click confirms the price shown.

  • Automatically, when an interruptible rental is stopped by Legion: see Automatic backup when a rental is interrupted.

Choose how long to keep it, 7 days or 30 days, and confirm the price shown. A backup can take a long time: hundreds of gigabytes can take hours, depending on the size and the host's upload speed. You can close the page. The rental's page shows the backup's state, size and price to every member of your organization, on any device, also after the rental is deleted. You get an email when it's ready.

A backup is queued until the host starts uploading, then uploading, then ready. It can end failed, cancelled, expired or deleted. While it uploads, the rental's page shows its progress and when it should finish (uploaded_bytes, estimated_completion_at).

The upload runs at the host's own upload speed and must finish within 12 hours. If the host's measured speed says a backup can't, the estimate says so and the backup is refused with backup_too_slow. Copy what you need off over SSH instead.

Through the API:

  1. estimateRentalBackup returns the price for a retention.

  2. createRentalBackup starts it and charges that price.

  3. getBackup, or the rental's latest_backup, shows it. Read it until state is ready. listBackups lists every backup of your organization, including those of deleted rentals.

  4. createBackupDownloadLink gives you a link to the file.

Shell
curl -s "https://api.legion.ambient.xyz/v1/rentals/$RENTAL_ID/backup-estimate?retention_days=7" \
  -H "Authorization: Bearer $LEGION_API_KEY"
Shell
curl -s -X POST "https://api.legion.ambient.xyz/v1/rentals/$RENTAL_ID/backups" \
  -H "Authorization: Bearer $LEGION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"retention_days": 7}'
Shell
curl -s "https://api.legion.ambient.xyz/v1/backups/$BACKUP_ID" \
  -H "Authorization: Bearer $LEGION_API_KEY"

To back up and stop, call stopRental with the query parameter backup_retention_days set to 7 or 30. To back up, then delete, call deleteRental with the same parameter, or createRentalBackup with "delete_rental_after": true.

One backup or workspace download of a rental can run at a time. Your organization can start up to 6 backups an hour, and 3 workspace downloads an hour.

Automatic backup when a rental is interrupted

An interruptible rental that keeps its data can back up its /workspace by itself when Legion stops it, so the 72 hours are never your only safety net. It's off unless you turn it on, because every backup is charged.

  • Turn it on with Back up automatically when this rental is interrupted in the rent form, choosing 7 or 30 days. On the rental's page, the Automatic backup section turns it on or off and changes the days, for the next time Legion stops the rental. Turning it on doesn't back up a stop that already happened. Through the API it's auto_backup on createRental and updateRental: {"retention_days": 7} or 30 is on, null is off.

  • Only for interruptible rentals set to Keep my data. An on-demand rental, or one set to Delete it, has no workspace to back up after a stop: naming auto_backup for one is refused with auto_backup_not_applicable.

  • The default. getStoragePolicy returns auto_backup_default_retention_days when Ambient has made automatic backup the default. A new interruptible rental that keeps its data then gets it unless you turn it off, and the rent form starts with the box checked. When the field is absent, it's off.

  • When it runs. Each time Legion stops the rental: preempted, outbid, or stopped because your organization ran out of credit. A stop you ask for isn't one; choose Back up and stop for that. The backup starts once the container has stopped. It never delays the preemption, its notice or the hand-over of the GPUs.

  • What it costs. Each one is charged as a backup, when it starts, at the backup prices: storage for the days you chose plus one download. The charge is based on the size the host last measured. When the host hasn't measured one, it's for up to the rental's whole disk share, and the difference is refunded when the real size is known.

  • While it runs, the rental waits. A rental with an automatic backup running does not start again: its auto_resume, and the place of a waiting bid in the spot auction, wait until the backup is ready. To resume sooner, cancel the backup (cancelBackup, or Cancel on the rental's page); a cancelled backup is refunded in full.

  • It's an ordinary backup. It's listed on the rental's page marked Automatic (automatic is true in the API), you get the same emails, and you download it the same way. Charges and refunds work as for any backup.

An automatic backup is skipped, never retried later, when it can't be made safely. The rental's page says why in plain words (auto_backup.last_skipped_reason and last_skipped_at in the API), the stop email says so, and the event rental.auto_backup_skipped is emitted:

Automatic backup when a rental is interrupted
last_skipped_reasonWhy it wasn't made
no_creditYour organization had no credit, or its balance didn't cover the backup's price.
backup_too_slowAt the host's measured upload speed, the backup wouldn't finish within 12 hours.
backup_in_progressA backup or a workspace download of the rental was already running.
host_offlineThe host stayed offline for 30 minutes after the stop.
host_unsupportedThe host's agent can't back up yet.
rental_heldThe rental is on hold. Contact support.
unavailableBackup storage or billing couldn't be reached for 30 minutes.
recent_backupAn automatic backup of the rental started less than 6 hours before, so a rental Legion stops again and again isn't charged a backup each time.

New reasons can be added, so treat one you don't know as "not backed up". After a skip, the 24 and 72 hour rules above still apply: back it up yourself within 24 hours if the files matter.

Download a backup

When the backup is ready, the rental's page shows its size, price and expiry date, and Download.

  • The price includes one download. Your first download link costs nothing more.

  • Each further link is charged for the transfer again, at $0.12 per GiB of the backup's size, as soon as it's made. The app says before you click whether the link is included or charged, shows that price before it makes the link, and it isn't refunded.

  • A backup can have up to 5 links made in 24 hours.

  • A link works once. The first time it is opened it is used up and sends you to the file, whose address stays valid for 5 minutes: enough for a download to start, and a started download keeps going. A second try, or a try more than 60 minutes after the link was made, answers 410 link_used. Make a new link, which is charged again if it isn't the first. Anyone who holds an unused link can use it, so don't log or share it.

Shell
curl -s -X POST "https://api.legion.ambient.xyz/v1/backups/$BACKUP_ID/download-links" \
  -H "Authorization: Bearer $LEGION_API_KEY"

The answer's url is a Legion address ending in /v1/downloads/<token>, not the file itself. Its charge is what the link cost: zero for the first. A retry with the same Idempotency-Key returns the same link while it is unused and unexpired; after that it answers 410 link_used, and you make a new link with a new key.

How long a backup is kept

  • 7 or 30 days from when it's ready, as you chose (expires_at).

  • An email 24 hours before it expires.

  • After it expires, or after you delete it, it can't be downloaded. Its file is purged for good 24 hours later.

  • Deleting a backup early refunds nothing. The app says so before you confirm. Call deleteBackup to do it through the API.

While a backup runs

While a backup is queued or uploading, nothing that would break it can happen to the rental:

  • it can't be started or deleted by anyone in your organization;

  • it isn't deleted when its 72 hours are up: the deletion waits for the backup to end;

  • its disk can't be reclaimed for another renter.

A stopped rental holds no GPUs, so preemption, being outbid and the rental of those GPUs to someone else don't touch a backup.

This has a time limit. A backup that hasn't started uploading 24 hours after you asked, or is still uploading 12 hours after it started, fails, and the rental's deletion no longer waits for it. Two things can still end a rental during a backup: the host leaving Legion, and an Ambient staff delete with a recorded reason. A staff delete cancels the backup and refunds what's left of its charge.

If a backup fails or is cancelled

You get an email with the reason, and the charge is refunded in full. A failed backup gives no extra time: the rental keeps its normal deadline. You can try again before it. If the deadline passed while the backup ran, the files can be deleted as soon as the backup fails.

A backup that's queued or uploading can be cancelled, like a workspace download: what was uploaded is discarded, the charge is refunded in full, and the rental can be started or deleted again at once (cancelBackup). A ready backup can't be cancelled (backup_not_cancellable); delete it instead.

When your organization closes

Backups are kept to the end of their 7 or 30 days, and you can still download them until then. Closing doesn't refund any part of a backup charge.

Backup pricing

Backup pricing
PartPrice
Storage$0.05 per GiB per 730-hour month, prorated by the hour, for the 7 or 30 days you chose
One download$0.12 per GiB, included in the price
Each further download link$0.12 per GiB, charged when the link is made
Text
backup price = GiB × $0.05 × days × 24 ÷ 730  +  GiB × $0.12

Each part is rounded up to the cent.

Example. A 100 GiB backup kept for 7 days:

Text
storage   100 GiB × $0.05 × 168 ÷ 730 = $1.16
download  100 GiB × $0.12             = $12.00
total                                 = $13.16

Kept for 30 days instead, it costs $4.94 + $12.00 = $16.94. A second download of it costs another $12.00.

How it's charged:

  1. Before you confirm, the app shows an estimate from the disk the rental uses on the host. If the host doesn't report that, the estimate is for the rental's whole disk share, shown as "up to" (estimate_basis disk_share). Your credit must cover it, or the backup is refused with insufficient_credit.

  2. When you ask, the estimate is taken from your credit.

  3. When the backup is ready, the price is worked out again from its real size, and any difference is refunded. You're never charged more than the estimate.

  4. If it fails, or you cancel it before it's ready, the charge is refunded in full.

A backup's price shows what was quoted, charged and refunded. Backup charges and refunds show in Spend and on the rental's Cost tab, and you get an email for each. They are paid to Ambient, not to the host's provider. See Credit and billing.

Why was my data deleted?

Every deletion of a rental's files is recorded with its date and reason, shown on the rental's page ("Files deleted on {date}: {reason}"), and emailed to your organization. Through the API, the rental has data_deleted_at and data_deleted_reason:

Why was my data deleted?
data_deleted_reasonWhat happened
renter_deletedA member of your organization deleted the rental, or a Back up, then delete finished.
retention_expired72 hours passed since the rental stopped.
reclaimedAnother renter needed the host's disk, more than 24 hours after the stop.
no_creditThe 72 hours ran out while your organization had no credit.
host_removedThe host's provider removed the host and chose to delete the renters' files with it, or a removal that waited for the files to go reached its 72-hour limit. When the host is leaving and waits for the files to go, you are emailed first, with the time your files are deleted and a link to back them up. When the provider deletes them at once, you are emailed after.
failedThe rental failed, and 72 hours passed.
preemptedAn interruptible rental set to Delete it was preempted or outbid.
adminAmbient staff deleted it, with a recorded reason. Contact support to learn why.

While the host removes the files, data_status is deleting; once it confirms, deleted. If the rental had a backup, the deleted rental still links to it.

Emails you get

Every member of your organization gets these:

Emails you get
EmailWhen
Rental stoppedWhen a rental stops: the date its files will be deleted, and a link to back up.
Files will be deleted12 hours before a stopped rental's 72 hours run out.
Files deletedWhen a rental's files are deleted, with the reason and any backup.
Backup readyThe size, price, expiry date and a link.
Backup failedWhy, and that the charge was refunded.
Backups expiring24 hours before a backup expires.
Backup charged or refundedEach backup charge, each further download link, and each refund.

The warnings before deleting a failed rental, 24 hours ahead, still go out.

Workspace download or backup?

A stopped rental also has Download workspace, a quick copy you take straight away (createWorkspaceExport). Making the file is free; each download link is charged by size (see Download a workspace). The page shows its upload progress, and Cancel download stops it (cancelWorkspaceExport). Both copy /workspace into one .tar file:

Workspace download or backup?
What you getDownload workspaceBackup
PriceMaking the file is free. Each download link is charged $0.15 per GiB of the file.Storage for the days you chose, plus one download
Kept24 hours7 or 30 days
RentalsStoppedStopped or failed
Download linksAs many as you need while the file exists, each charged and each working onceThe first is included; each further one is charged and works once
Limit3 an hour for your organization6 an hour for your organization
Progress, and cancel while it uploadsYesYes
Time limitFails if not finished 24 hours after you askedFails if not uploading 24 hours after you asked, or not finished 12 hours after the upload started
Back up and stop, or then deleteNoYes
EmailsNoReady, failed and expiring

Use Download workspace to take your files now, while you're there to download them within 24 hours and pay the transfer. Use a backup to keep them longer, to download them later or from somewhere else, to save a failed rental's files, or to stop or delete a rental and have the copy made for you.

Download a workspace

A workspace download has three steps, and the app shows the price before each:

  1. Before you start, the page shows an estimate: the size of your workspace (the host reports it; if it doesn't, the rental's whole disk share, shown as "up to"), the price of $0.15 per GiB, the estimated charge, that a link works once and lasts 60 minutes, and the limit of 3 downloads an hour. Starting the download is free. Through the API this is estimateWorkspaceExport.

  2. When it is ready, the page shows its size and the exact charge, and Make download link. The charge is the file's size in GiB times the price, rounded up to the cent, at least 1 cent. getWorkspaceExport no longer returns an address: its download_url and expires_at are never present.

  3. Make the link. It confirms the charge, takes it from your credit and gives you a link to open or copy. createWorkspaceExportDownloadLink needs an Idempotency-Key. The link works once and expires after 60 minutes. Opening it uses it up and sends you to the file, whose address stays valid for 5 minutes; a download that has started keeps going.

If a step fails, the app says why in plain words:

Download a workspace
AnswerWhat it means
402 insufficient_creditYour credit doesn't cover the charge. Add credit, then make the link.
410 link_usedThe link was already used or has expired. Make a new link. It is charged again.
429 rate_limitedYour organization started its 3 downloads for this hour. The answer's Retry-After says when to try again.
409 export_not_readyThe file isn't finished yet.

For providers

A provider who removes a host while renters' files are on it must choose explicitly: wait until the files are gone, or delete them now. See Removing or moving a host.

On your host, a stopped rental's files take disk for at most 72 hours. Your host's free disk counts files that can be reclaimed, so renters can rent it, and a new rental waits until the old files are removed.

You earn your share of the storage renters pay while files are on your host. Backups are stored by Ambient, not on your host, and you earn no share of backup charges; they don't change your earnings for rentals. While a backup runs, the agent uploads /workspace from your host, and the rental's files stay until it ends. See Earnings and payouts.

The Terms of Use (opens in a new tab) (sections 6.4, 6.5, 8 and 11.3) and Data Handling (opens in a new tab) (section 7) are the binding text. This page explains them.

Next steps