data:image/png;base64,...) for inline file content, but URLs are the universal format that works with every model.
The CDN is the recommended approach for file inputs. You upload once, get a persistent URL, and reuse it across as many inference requests as you need. The SDK automatically handles reliability by falling back between multiple upload endpoints if one is unavailable. If you already host files on S3, GCS, or your own server, you can skip the upload and pass those URLs directly.
Uploading Files
Using Your Own Storage
You don’t have to use fal’s CDN. If you already have files hosted elsewhere, pass those URLs directly. The model’s runner downloads the file from that URL during processing, so the URL must be accessible without additional authentication headers. Presigned URLs from S3, GCS, or R2 work because the auth credentials are embedded in the URL itself:Authorization headers or other credentials will not work as model inputs when calling Model APIs. If your files are behind authentication, download them first and upload to fal’s CDN, or generate a presigned URL with a short expiry. If you are building your own fal App, you can download authenticated files inside your endpoint using download_file with request_headers.
Data URIs
Models also accept base64-encoded data URIs:Upload Details
| Property | Value |
|---|---|
| CDN URL format | https://v3.fal.media/files/{path} |
| Large files | Automatically uses multipart upload for large files (10 MB chunks). Python SDK: threshold 100 MB, up to 10 parallel chunks. JavaScript SDK: threshold 90 MB, sequential chunks. |
| Retries | Automatic retry up to 10 attempts on transient errors |
| Fallback | If the primary endpoint (v3.fal.media) is unavailable, the SDK automatically falls back to fal.media, then to the REST API |
| Auth | Handled automatically by the SDK using your FAL_KEY |
| Access | CDN URLs are publicly accessible. No auth needed to download. Anyone with the URL can access the file. |
Uploading PIL Images
If you’re working with PIL/Pillow images in Python:Media Expiration
CDN file retention is configurable. You can set expiration per-request using theX-Fal-Object-Lifecycle-Preference header, or configure retention at the account level.
Data Retention and Storage
Configure how long CDN files are retained
Building a Serverless App?
If you’re building a fal App and need to handle files inside your endpoint code (returning images, downloading inputs), see the server-side guide:Working with Files
Server-side file handling: download_file, File.from_path, Image.from_pil