Short answer
Vercel caps the request body and the response body of a Vercel Function at 4.5 MB. If a file upload goes through your function, upload it from the browser straight to storage instead, for example with Vercel Blob client uploads. If the response is too big, return less per request or stream it. When you measure, remember the browser’s network tab shows the gzipped size by default.
Find which body is too big, then fix it
01
A file upload passes through the function
“The maximum payload size for the request body or the response body of a Vercel Function is 4.5 MB.” Vercel, Functions limits
Posting a photo, video or PDF to your own API route sends the whole file through the function, and anything over the limit is rejected. Upload from the browser straight to your storage instead. With Vercel Blob that’s a client upload: the file goes from the browser straight to Blob and never passes through your function.
02
The response is too big
“The best way to avoid the 413 error is to reduce the amount of data being returned per function request.” Vercel, How to bypass the 4.5 MB body size limit
The same limit applies to what the function sends back, such as a whole table as JSON or a generated file. Return less per request: filter, paginate, or split a large page into smaller requests. Vercel says this can also show up as a 500 FUNCTION RESPONSE PAYLOAD TOO LARGE error.
03
The response can’t get smaller
“In this case, we recommend using streaming functions, which don't have this limit.” Vercel, How to bypass the 4.5 MB body size limit
If the data really has to come back in one go, stream it. Vercel recommends streaming functions for this case.
04
One request carries too much data
“If the payload data is too large to be sent in a single request, consider splitting the data into smaller chunks and sending multiple requests” Vercel, FUNCTION_PAYLOAD_TOO_LARGE
Bulk imports and big form submissions can go over the limit even without files. Split the data into smaller chunks and send several requests, or put it in storage and send only a reference.
05
The size you measured isn’t the real size
“However, note that by default this will show you the gzipped size. To see the true size, enable Big Request Mode.” Vercel, How to bypass the 4.5 MB body size limit
Chrome DevTools can make a response look smaller than it is, because the Network tab shows the compressed size by default. Turn on Big Request Mode to see the real size before deciding which fix you need.
Checked against the vendor’s docs on : Vercel docs: FUNCTION_PAYLOAD_TOO_LARGE; Vercel docs: Functions limits; Vercel guide: How to bypass the 4.5 MB body size limit.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Vercel function timeout (504) · Vercel environment variables undefined · Bolt or Lovable build fails on deploy · Vercel Module not found