Fastest fix: the file lived in a temporary Code Interpreter sandbox that has already been recycled, so the link is dead. Don’t try to repair it. Open the same chat (or a new one), ask ChatGPT to regenerate the file, then click download within a few seconds and confirm it opens. That solves the large majority of cases.
ChatGPT’s “generated files” run inside the temporary Code Interpreter / Advanced Data Analysis Python sandbox. That sandbox is created per conversation and recycled after a short idle window — as of June 2026, community reports and OpenAI’s own session model put it around 30 minutes of inactivity, sometimes as little as 15 and rarely past about an hour; large or long-running tasks get recycled sooner. After the sandbox is reaped, the file is gone even though the link still looks like a permanent URL. Click it and you get a 404, a 0-byte file, an endless spinner, or one of these strings:
The code interpreter tool session has expired.file not foundThis file is no longer available.
Once you understand that the link points into an ephemeral sandbox, most download failures diagnose themselves.
Which bucket are you in?
| Symptom | Most likely cause | Go to |
|---|---|---|
| Worked seconds ago, fails minutes later | Sandbox TTL expired | Step 1, Step 2 |
| Failed right after you refreshed the page | Sandbox rebuilt on refresh | Step 2 |
Link present but no python / “Analyzed” block in the reply | File never generated (fabricated link) | Step 4 |
| ”I can’t run analysis right now” earlier in the chat | Plan quota exhausted | Step 3, FAQ |
| Fails in one browser, works in another | Browser / extension blocking | Step 5 |
| Download reaches 100% then file is missing or 0 bytes | Browser blocked the MIME type | Step 5 |
| Fails in the iOS/macOS app, works in Safari/Chrome | Client routing difference | Step 7 |
Common causes (highest hit rate first)
1. Sandbox session expired, link invalid
The most common failure. The file was generated, you waited, clicked download — sandbox already reaped. Link 404s or shows file not found / The code interpreter tool session has expired.
How to spot it: click within ~5 seconds of generation and it works; click 15-30 minutes later and it fails. That gap is the TTL expiring.
2. Page refreshed after generation, sandbox cleared
A refresh (or a long idle period that forces a reconnect) triggers a sandbox rebuild. Files generated in the old sandbox don’t carry over; old links break.
How to spot it: download worked right after generation, you refreshed, and the same link now fails — the sandbox was rebuilt under you.
3. The file was never actually generated (fabricated link)
The model can produce a normal-looking download link without ever invoking the Python tool. The link 404s on the first click because nothing was written to disk.
How to spot it: no grey python code block in the reply and no “Analyzed” / “Working” indicator means Code Interpreter never ran. Tell it to “actually run the analysis tool and generate the file” and compare.
4. Plan-level generation / download quota hit
The free tier’s Code Interpreter has tight usage limits, and they reset on a rolling window rather than at a fixed time. When you’re out, the model may still narrate “I’ve created the file” while the actual run silently fails, so the download is empty.
How to spot it: it worked earlier in the same session and now fails, and the model recently said something like “I can’t run analysis right now.” See the FAQ for the per-tier picture.
5. Browser security policy / extension blocking
Brave’s aggressive shields, ad blockers, and enterprise proxies can block the download (especially the CDN host files.oaiusercontent.com, which is not openai.com). Some large binaries or rare MIME types get silently dropped with a “file may be dangerous” warning.
How to spot it: it works in an incognito window or with the ad blocker off — that’s a browser problem; it fails in every browser — that’s the sandbox.
6. File too large or MIME type blocked by the browser
Large archives and uncommon types sometimes finish “downloading” but never land.
How to spot it: the progress bar reaches 100% but the file isn’t in Downloads or is 0 bytes. Open chrome://downloads (or your browser’s download history) and look for Failed - Blocked / Blocked: dangerous.
7. App vs web routing differs
The iOS and macOS apps sometimes save directly to Files / Downloads instead of routing through a browser, and they report a generic “can’t download” when the underlying sandbox has expired. The same link pasted into Safari or Chrome may behave differently.
How to spot it: the app download fails, you copy the link into Safari or Chrome, and the result changes — that’s a client routing difference, not the file.
Before you start
- Note whether this is a plain chat, a Project, or a Custom GPT. Code Interpreter behavior and limits differ across the three.
- Screenshot or copy the message containing the download link before you retest — once you regenerate, the old link is gone.
- Confirm your plan (Free / Go / Plus / Business / Enterprise). As of June 2026, Go is $8/mo and Plus is $20/mo; the higher tiers raise the Code Interpreter ceilings.
Info to collect
- Generated file type and rough size (KB / MB).
- Elapsed time between generation and the click that failed.
- Browser and OS, plus any ad blockers or privacy extensions.
- The exact failure mode: 404, 0-byte file, endless spinner, or one of the error strings above.
- Current model in the picker (
GPT-5.5 Instant/Thinking/Pro) and subscription tier.
Shortest fix path
Ordered by payoff. The first two solve the large majority of cases.
Step 1: Download the file the instant it appears
The single most important habit. When you see the link or the “Download” button:
- Click immediately — don’t read the content first.
- Stay in the same conversation; do not refresh or switch chats.
- Save it locally and confirm the file opens before you continue.
If you need to preview the content first, have the model print it inline too so you don’t have to gamble:
Generate the file and also paste the first 30 lines inline so I can
sanity-check before downloading.
Step 2: If it failed, ask for a fresh regeneration
Don’t try to repair a dead link — get a new one. The sandbox link is not addressable, so reloading it cannot work; only a re-run does.
That download link returned a 404 / "code interpreter session has expired".
Please re-run the analysis tool and regenerate the file as a new download
in this conversation.
If you need both runs to match byte-for-byte, pin the randomness and ordering in the prompt (for example random_state=0, an explicit column order, and a fixed sort) so the regenerated file is identical.
Step 3: For large or text-shaped files, switch to inline output
For CSV / JSON / Markdown / code, skip the file entirely and have it printed in the chat, which sidesteps the sandbox TTL completely:
Don't write to a file. Output the full content as a single fenced
code block. I'll copy it manually.
Practical for up to roughly tens of thousands of rows; past that, prefer the file plus the immediate-download habit from Step 1.
Step 4: Verify Code Interpreter actually ran
This kills the fabricated-link failure mode:
Use the analysis tool. Generate the file. After generating, print:
1. The full path of the generated file
2. The output of os.path.getsize(path)
3. The first 10 lines of the file
All three printed means it really ran. A link with none of these means the model may be fabricating — re-issue with “actually execute the tool.”
Step 5: Switch browser / disable extensions
If Chrome fails:
- Try Brave, Firefox, or Safari.
- Turn off ad blockers and privacy extensions (or lower Brave Shields for
chatgpt.com). - Use an incognito / private window (most extensions are off by default).
- Check
chrome://downloadsforFailed - Blocked.
If it still fails in every browser, treat it as sandbox expiry and go back to Step 2.
Step 6: Pull the file with curl as a fallback
If the file is still live in the sandbox but your browser keeps blocking it, copy the real CDN URL (it starts with https://files.oaiusercontent.com/, not the in-chat sandbox:/mnt/data/... reference, which is not a public URL) and fetch it yourself:
# Grab your session cookie from DevTools -> Application -> Cookies on chatgpt.com
curl -L "https://files.oaiusercontent.com/..." \
-H "Cookie: __Secure-next-auth.session-token=YOUR_COOKIE" \
-o output.csv
This bypasses extension and routing problems. It does not bypass sandbox expiry — if the sandbox is already gone, regenerate first (Step 2).
How to confirm the fix
- Open a fresh chat, regenerate the same task, download it, and open it — correct content means it’s truly fixed, not a lucky retry.
- Ask ChatGPT to paste the generation code and run it locally; reproducing the same output confirms it isn’t a transient sandbox blip.
- Have a colleague run the same prompt in their account and download — success there means the problem wasn’t unique to your session.
If it’s still broken
- Shrink the task to a 10-line hello-world file and see whether that downloads. If even that fails, the sandbox or your account is the issue, not the data.
- Try several file types (CSV, TXT, PDF) to rule out a per-type render or download path.
- Switch model and device:
GPT-5.5 ThinkingvsInstant, web vs app, Chrome vs Safari. - Package the prompt, a generation screenshot, the exact failure string, and your tier, then file a ticket at help.openai.com.
FAQ
Why do ChatGPT download links expire so fast?
The file lives only inside the per-conversation Python sandbox, which is recycled after a short idle window — about 30 minutes is typical as of June 2026, sometimes as little as 15, rarely past an hour, and sooner for heavy tasks. The link looks permanent but points into storage that no longer exists once the sandbox is reaped.
Can I recover a file after the link 404s?
No. There is nothing to repair once the sandbox is gone. Regenerate it (Step 2). If the original run was non-deterministic, pin random_state and sort order so the new file matches the old one.
Does paying for Plus or Pro fix this?
Higher tiers raise Code Interpreter usage limits and reduce quota-related failures, but every tier uses the same ephemeral sandbox, so the TTL still applies. The fix is the download-immediately habit, not the plan. (As of June 2026: Free, Go $8, Plus $20, Pro $100 or $200.)
Is Code Interpreter available on the free plan?
Yes, with tight rolling limits. Free accounts run a smaller default model rather than GPT-5.5, and when the analysis quota runs out the model may still claim it made a file while the run silently failed (cause #4). If files just stopped working mid-session, you’ve likely hit the quota.
The link is sandbox:/mnt/data/file.csv. Why won’t it download?
That sandbox:/mnt/data/... form is an internal reference, not a public URL — it only resolves inside the ChatGPT interface. Click the actual download button instead, or ask the model to “give me the downloadable file,” which produces a real files.oaiusercontent.com link.
How do I stop this from happening again?
Download files the moment they appear, never “after a few more messages.” For text-shaped output, prefer inline (Step 3). Ask for the generation code alongside the file so you can re-run locally if the link dies, and always open the downloaded file before closing the chat instead of discovering a 0-byte file hours later.
Related reading
- ChatGPT file upload failed
- ChatGPT file type unsupported
- ChatGPT misreads your CSV / Excel data file
- ChatGPT Projects
- ChatGPT file analysis
- ChatGPT Projects advanced workflow
Tags: #ChatGPT #ChatGPT files #Troubleshooting #Debug #Download