Vercel FUNCTION_PAYLOAD_TOO_LARGE (413): fix a request body that is too big
FUNCTION_PAYLOAD_TOO_LARGE means the request body sent to a Vercel Function is bigger than the function may receive.
Why do I get FUNCTION_PAYLOAD_TOO_LARGE on Vercel?
Vercel returns 413 Payload Too Large when a request body exceeds the limit for the function. The default request body limit is 4.5 MB.
Vercel also offers an opt-in 20 MiB limit in Public Beta for Node.js, Python and Bun functions that use fluid compute and Performance (4 GB) memory.
How do I fix it?
- Reduce or compress the payload. Send only the fields the function needs, or compress the data before sending it.
- Upload large files from the client. Send the file straight to Vercel Blob, then send only its link to the function.
- Split the data into several requests. Keep each request body below the applicable limit.
- Use external storage. Store very large data outside the request and pass the function a link or identifier.
- Check whether the larger limit fits. The opt-in 20 MiB Public Beta limit requires a Node.js, Python or Bun function with fluid compute and Performance (4 GB) memory.
What can I paste into my coding agent?
text
Read https://vercel.com/docs/errors/FUNCTION_PAYLOAD_TOO_LARGE and https://vercel.com/docs/functions/limitations#request-body-size. Look only at files in this repo for upload routes and the code that sends request bodies to them. Find the likely oversized request and propose the smallest fix. Do not change any project settings. Report what I must check myself in the Vercel dashboard.Related
See Vercel function timeout for 504 errors and Vercel deployment errors for other codes. Automate fixes explains the coding-agent workflow, VibeOps covers keeping shipped apps running, and the quickstart shows how to connect your coding agent.