Vercel · infra · fg-0245

Upload or large JSON to a Vercel Function fails with 413 FUNCTION_PAYLOAD_TOO_LARGE

If you see 413: FUNCTION_PAYLOAD_TOO_LARGE, the cause and the fix for Vercel are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
413: FUNCTION_PAYLOAD_TOO_LARGEFile uploads above about 4.5 MB fail in production but work locallyLarge API responses are cut off with the same error
Cause
Vercel Functions accept at most 4.5 MB in the request body and return at most 4.5 MB in the response body. The limit is enforced at the platform edge, so local dev servers never show it.
Fix
Send large files straight from the browser to object storage with a presigned or client upload URL, and return only a reference from the function. Page or stream large responses.
Apply
// client: upload directly to storage, then POST only the resulting URL import { upload } from '@vercel/blob/client'; const blob = await upload(file.name, file, { access: 'public', handleUploadUrl: '/api/upload' }); await fetch('/api/save', { method: 'POST', body: JSON.stringify({ url: blob.url }) });
Affected
Vercel Functions on all plans, all runtimes, as of October 2026
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun