# Downloads

Launch with `"downloads": true` and every file the browser downloads in that session is kept. After the session ends the files are listed in the dashboard and under `GET /v1/me/downloads`, and each one can be fetched through a private link for 2 days.

## Two ways to get a file

-   **In your code, while the session runs** — no option needed: Playwright's `download.saveAs()` (or `createReadStream()`) streams the file to your machine over the session's connection, byte-exact ([case 12](https://cdpfleet.com/docs/cases/files-up-and-down)). Without `downloads` the file is deleted with the session.
-   **Kept, after the session** — with `"downloads": true`: for downloads your code can't catch, such as a person clicking in [live view](https://cdpfleet.com/docs/live-view) or Launch interactive, an AI agent working through the [MCP server](https://cdpfleet.com/docs/mcp), a client that disconnected (`keep_alive`) or crashed, or exports you collect later. Your code still gets its downloads as usual.

## Launch, then fetch

```
// 1. Launch with downloads kept
POST https://starter.cdpfleet.com/chrome/session
{ "proxy": "http://user:pass@your-proxy:8080", "headless": "new", "downloads": true }

// 2. After the session ends (files are listed within a few seconds)
GET https://cdpfleet.com/v1/me/downloads?session_id=<sessionId>
→ { "files": [{ "id": "…", "name": "report.pdf", "bytes": 48213, "sha256": "…", "expires_at": "…" }] }

// 3. A private link to one file, valid 15 minutes
GET https://cdpfleet.com/v1/me/downloads/<id>/url
→ { "url": "https://cdpfleet.com/v1/downloads/…", "expires_in_s": 900 }
```

Every file is served as an attachment of type `application/octet-stream`: what a web page hands a browser can be anything, so it never opens on cdpfleet.com. Check the `sha256` if you pass files on.

## Limits

<table><tbody><tr><th scope="row">Plans</th><td>Every paid plan; not Community (<code>403 downloads_not_available</code>)</td></tr><tr><th scope="row">Per session</th><td>Up to 1 GB and 200 files; further files aren't kept (your code still receives them)</td></tr><tr><th scope="row">Per account</th><td>1 GB; when a new session's files would pass it, the oldest files are deleted</td></tr><tr><th scope="row">Kept for</th><td>2 days, then deleted; <code>DELETE /v1/me/downloads/{id}</code> deletes one sooner</td></tr><tr><th scope="row">Browsers</th><td>All of them</td></tr></tbody></table>

## Not kept

-   Downloads in browser contexts a raw-CDP client creates itself (Puppeteer's `createBrowserContext()` over `cdpUrl`); downloads in the default context and in Playwright contexts are kept.
-   Contexts opened with `acceptDownloads: false`: the browser doesn't download at all.
-   WebKit doesn't treat a `text/plain` response with `Content-Disposition: attachment` as a download.

---
Source: https://cdpfleet.com/docs/downloads · Markdown: https://cdpfleet.com/docs/downloads.md · All docs for AI tools: https://cdpfleet.com/llms.txt
