# Retention, exports and deletion

Source: https://platform.lyrouter.com/ai_gateway/docs/retention/en
Last updated: 2026-10-22

How many days log content (conversations, raw packets, routing candidates and attempt records) can be viewed is set by the account's subscription; after the retention period, logs keep only metadata. Log records themselves are kept for at most 180 days and are then deleted automatically. For long-term retention, the current Account Owner or a workspace Admin can create an encrypted export for a time range within the retention period; export files are kept for 24 hours.

## Checking the retention period

On the workspace's **Log analysis** page, click **Log storage settings**. The top of "Log detail storage policy" shows the account's "Rolling capacity: N detail entries" and "Detail retention: N days". Both values come from the account's subscription; each plan's Log detail entries and Log retention are shown on its plan card on the **Subscription & Credits** page; see [Billing and Credits](https://platform.lyrouter.com/ai_gateway/docs/billing/en).

(Screenshot: Log detail storage policy shows the current rolling capacity and detail retention days.)

| Content | How long it can be viewed |
| --- | --- |
| Metadata: time, API key, model, provider, status code, Tokens, cost, latency and so on | 180 days, after which the whole log entry is deleted automatically |
| Content: Conversation, Raw packets, the candidates and upstream call attempts in the route trace, security review matches | Within the subscription's Detail retention days |
| Export files | 24 hours after the export task is created |

- **Past the retention period**: the log is still in the list and its metadata can be viewed; the details are marked "Detail retention expired" with the note "Metadata remains available, but content is older than the N-day retention period for this plan."
- **Based on the current subscription**: retention is calculated from the account's subscription at the time you view the log; when the subscription changes, the time range of viewable content changes with it.
- **Logs without stored content**: when the workspace has not turned on content logging, logs have only metadata to begin with, and their details show "Content was not recorded for this log"; see [Logs and data processing](https://platform.lyrouter.com/ai_gateway/docs/privacy/en).
- **Rolling capacity and overflow**: Rolling capacity is the number of log detail entries included in the subscription. It is counted per account and shared by every workspace with content logging on, and only requests made after content logging is enabled count; older content beyond the capacity is cleared about once a day. Only when operations have set an overflow price for the plan does the dialog show a "Paid overflow retention" switch: turned on, content beyond the capacity is kept and billed at the unit price shown there from your paid balance. This switch applies to the whole account: changing it in any workspace affects every workspace in the same account. Click **Save** after changing it. Plans have no overflow price by default, so the switch is not shown.

## Encrypted export

The current Account Owner and workspace Admins can export logs as an encrypted file; for other members the **Export** button is unavailable. Recent exports lists only the tasks you created yourself in the current workspace, and only the creator can download them.

1. On the **Log analysis** page, set the search term and filters; the export reuses them (except the time range).
2. Click **Export** to open "Export logs".
3. Choose CSV or JSON as the Export format; the default is JSON.
4. Fill in the Export time range: if the list has a time range selected, it is reused by default; otherwise enter the start and end time yourself. Changing the export time does not affect the list filters.
5. Set a File password, which you use to open the downloaded encrypted file. Keep the password safe; if you forget it, you can only export again.
6. Click **Create export**. The task is queued and generated in the background and keeps running after you close the window. Each account can have only one task that is Queued or Generating at a time; otherwise the console shows the Chinese message 「已有导出任务正在处理或队列繁忙，请稍后重试」 (an export task is already being processed or the queue is busy; try again later).
7. When the task status becomes Ready, click **Download**. In "Download logs", click **Send code**, enter the 6-digit SMS code sent to your bound phone number, check "I understand and will protect this sensitive data", then click **Verify and download**.
8. Open the downloaded ZIP file with the password you set when creating the task.

| Item | Limit |
| --- | --- |
| Time range | At most 31 days per export; an end time later than now is cut off at the current time |
| Entries | At most 50,000 per export; beyond that, the task is marked Limit reached |
| File password | 6–128 characters |
| File format | AES-256 encrypted ZIP containing `ai-logs.csv` or `ai-logs.json`. Your system's built-in unzip tool may not open it; use a tool that supports AES encryption, such as 7-Zip |
| File retention | 24 hours after the task is created; Time remaining shows a countdown, and when it runs out the file is deleted and the task is no longer shown |

The export includes metadata plus the stored prompts, conversations, model responses and the bodies of the four packets, but not request or response headers. Logs past the retention period or without stored content export metadata only, with `content_state` set to `expired` or `not_stored` respectively; when content is present it is `stored`.

(Screenshot: In Export logs, choose the format and time range and set a file password.)

## Deletion

- **Export files**: deleted from storage 24 hours after they are created, and the download link stops working at the same time.
- **Log content**: no longer shown once the retention period has passed; after content logging is turned off, new requests no longer store content.
- **Log records**: deleted automatically after being kept for 180 days.
- **API keys**: after an API key is deleted, the logs it has already produced are still kept for the periods above.

The console does not offer a way to delete individual log entries by hand. To have personal information or account data deleted, contact the platform as described in the [Privacy policy](https://platform.lyrouter.com/ai_gateway/legal/privacy-policy).

## FAQ

### Can an export recover content that was never stored or has expired?

**Answer:** No. An export contains only what can still be viewed at export time; requests made while content logging was off, and logs past the retention period, have metadata only. To keep content long term, export it regularly within the retention period.

### The dialog says "Log exports are not enabled. Contact an administrator to configure object storage." What should I do?

**Answer:** The current deployment has no storage configured for export files, so export tasks cannot be created. Contact the platform administrator.

### The console says "Each export supports up to 31 days. Adjust the export range; this will not change the list." What should I do?

**Answer:** Shorten the Export time range and export in several parts. Only one task at a time can be queued or generating, so create the next task after the previous one becomes Ready.

### The download says 「请先在账号设置中绑定可用手机号」 (bind a usable phone number in Account settings first). What should I do?

**Answer:** The download code is sent to the phone number bound to the account that created the task. Bind a usable phone number in Account settings, then go back to Recent exports and click **Download**. Only the creator can download an export task; other administrators need to create their own task.
