> ## Documentation Index
> Fetch the complete documentation index at: https://fal.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> fal has two developer products. Model APIs run hosted models through an API key. fal Serverless deploys your own Python apps and models on fal GPUs.
> To call a hosted model, start with the [Quick Start](https://fal.ai/docs/documentation/quickstart.md) and the [Model APIs overview](https://fal.ai/docs/documentation/model-apis/overview.md).
> To deploy your own model with fal Serverless, start with these pages:
> - [Introduction to Serverless](https://fal.ai/docs/documentation/serverless/index.md): What fal Serverless is and the three ways to deploy on it.
> - [Installation & Setup](https://fal.ai/docs/documentation/development/getting-started/installation.md): Install the fal CLI with `pip install fal` and authenticate.
> - [Quick Start](https://fal.ai/docs/documentation/development/getting-started/quick-start.md): Build a Hello World app, test it with `fal run`, and ship it with `fal deploy`.
> - [App Lifecycle](https://fal.ai/docs/documentation/development/app-lifecycle.md): How a `fal.App` goes from code to running runners.
> - [Define Your Endpoints](https://fal.ai/docs/documentation/development/endpoints-overview.md): Structure the API endpoints that your app exposes.
> - [Deploy to Production](https://fal.ai/docs/documentation/deployment/deploy-to-production.md): Persistent URLs, authentication modes, and automatic scaling.
> - [Machine Types](https://fal.ai/docs/documentation/deployment/machine-types.md): Available GPU and CPU machine types and how to choose one.
> - [Pricing](https://fal.ai/docs/documentation/serverless/pricing.md): Per-second billing and the runner states that are billed.
> - [Scaling Parameter Reference](https://fal.ai/docs/documentation/deployment/scale-your-application.md): Parameters that control runners, concurrency, and scale to zero.
> - [Optimizing Cold Starts](https://fal.ai/docs/documentation/serverless/optimizations/optimize-cold-starts.md): Causes of cold starts and ways to make them shorter.
> - [Examples](https://fal.ai/docs/examples/index.md): Complete Serverless apps for image, video, audio, 3D, realtime, and multi-GPU workloads.
> - [Migrating to fal](https://fal.ai/docs/documentation/development/migrating-to-fal.md): Guides to move an existing Docker server or an app from another platform to fal.
> fal Serverless deploys need access that the fal team approves for each account. Request access at https://fal.ai/dashboard/serverless-get-started.

# Data Retention & Storage

> Understand app-owner responsibilities for customer content in Serverless logs, persistent storage, and media uploads.

As a Serverless app owner, you control what your application stores and logs. Review every place your code and its dependencies write customer content, including prompts, uploaded media, and generated outputs.

If you only call hosted model endpoints, see [Model API Data Retention & Storage](/docs/documentation/model-apis/media-expiration) for the controls available to API callers.

## Who Controls Retention?

| Storage path | Responsible party |
| - | - |
| **Request-history payloads** | fal applies the caller's `X-Fal-Store-IO` header. No app-side handler is needed. |
| **Application logs** | The app owner controls what the app and its dependencies emit. |
| **Persistent storage** | The app owner controls writes and cleanup in `/data`, KVStore, and any external stores used by the app. |
| **CDN media** | The app owner uses toolkit uploads to apply the caller's expiration and access preferences to generated files. |

## Request Payloads

Request I/O retention is controlled by the `X-Fal-Store-IO` header and handled by fal. No action is needed in your app code. See [Request Payloads](/docs/documentation/model-apis/media-expiration#request-payloads) for details.

## Content-Bearing Logs

fal captures application output from `stdout` and `stderr`, including `print()` calls, Python logging, and error tracebacks. As the app owner, ensure your code and its dependencies avoid emitting customer content when your retention requirements prohibit storing it. Review exception messages and debug output as well as intentional application logs.

See [Logging](/docs/documentation/development/logging) for how logs are captured and exposed.

## Persistent Storage

Files written to the shared [`/data` volume](/docs/documentation/development/use-persistent-storage) persist across requests, runner restarts, and deployments until you delete them. As the app owner, manage which files are written and when they are removed. Runner shutdown does not delete these files.

If customer content must not persist after processing, avoid writing it to `/data` or other persistent stores. Review library caches and intermediate files as well as final outputs. If your app uses [KVStore](/docs/documentation/development/use-kv-store) or an external database or object store, manage that store's retention separately.

## Uploaded and Generated Media

Return generated files through toolkit types such as `fal.toolkit.Image` and `fal.toolkit.File` to apply the caller's `X-Fal-Object-Lifecycle-Preference`, including expiration settings and `initial_acl`, to CDN uploads. See [Controlling Access to Returned Files](/docs/documentation/development/working-with-files#controlling-access-to-returned-files) for implementation patterns. If your app enforces its own output ACL, preserve the caller's expiration settings as shown there.

fal passes `X-Fal-CDN-Token` to your runner for CDN downloads and uploads on behalf of the API caller. Toolkit uploads use the caller's CDN token automatically, so generated files belong to the caller. For custom uploads, see [ACLs Inside a Serverless App](/docs/documentation/model-apis/file-access-controls#acls-inside-a-serverless-app).

## Zero Data Retention (ZDR)

For Serverless workloads with ZDR requirements:

* Have callers disable request-history storage.
* Avoid retaining customer content in application logs and persistent storage.
* Honor the caller's CDN expiration and access preferences.

[Contact the sales team](https://fal.ai/enterprise#contact-sales) to confirm ZDR availability and coverage for your deployment.
