Vercel Functions now accept inbound request bodies up to 20MiB, up from 4.5MB, in Public Beta. To turn this on, set the VERCEL_SUPPORT_LARGE_REQUEST_BODY=1 environment variable. The opt-in applies to the whole project in the environment where you set it, so you can test the larger limit on preview before enabling it in production. It requires the project's functions to use the performance memory setting of 4GB. It applies to functions on the Node.js, Python, and Bun runtimes, and to Routing Middleware. Functions and Routing Middleware on the Edge runtime keep the 4.5MB cap and return 413 on oversize bodies, so moving them onto the larger limit means switching to the Node.js runtime with runtime: 'nodejs', or proxy.ts in Next.js. When a project opts in, Routing Middleware receives request headers and metadata but no request body, enforced at the project level. Middleware still runs and still sees every other request header, so body-dependent middleware behavior is the one thing that becomes unavailable. This avoids sending the body twice, to both middleware and the target function, which would raise cost and time to first byte. When handling larger request bodies, read the body promptly and avoid holding it in memory to prevent backpressure and memory issues. Learn more in the Vercel Functions limitations documentation.
AI NEWS JOURNAL
VercelAI NEWS / JOURNAL
Vercel Functions now support request bodies up to 20MiB
Vercel Functions now allow inbound request bodies up to 20MiB, up from 4.5MB, during public beta. To enable this feature, set the VERCEL_SUPPORT_LARGE_REQUEST_BODY=1 environment variable, which applies project-wide and requires a 4GB memory setting for functions on Node.js, Python, and Bun runtimes, as well as Routing Middleware. Edge runtime functions retain the 4.5MB limit and return a 413 error for oversized bodies. When enabled, Routing Middleware receives headers and metadata but not the request body to avoid duplication and reduce latency. Developers should read large request bodies promptly to prevent memory issues.