# Vercel Functions now accept request bodies up to 20MiB in public beta

published: 2026-11-21T02:05:46.525Z
topic: infrastructure
source: https://vercel.com/changelog/vercel-functions-now-support-request-bodies-up-to-20mib
url: https://aiagentnews.io/stories/vercel-functions-now-accept-request-bodies-up-to-20mib-in-public-beta

Vercel Functions can now receive inbound request bodies up to 20MiB, up from 4.5MB, in public beta. The larger limit is opt-in per project through an environment variable and requires the 4GB performance memory setting.

The higher limit is enabled by setting the VERCEL_SUPPORT_LARGE_REQUEST_BODY=1 environment variable. The opt-in applies to the whole project in the environment where it is set, so teams can test on preview before turning it on in production. The project's functions must use the performance memory setting of 4GB.

The change covers functions on the Node.js, Python and Bun runtimes, along with Routing Middleware. Edge runtime functions and middleware keep the 4.5MB cap and return 413 for oversized bodies. Moving them to the larger limit means switching to the Node.js runtime with runtime: 'nodejs', or to proxy.ts in Next.js.

When a project opts in, Routing Middleware receives headers and metadata but no request body, enforced at the project level. Middleware still runs and sees all other headers, so only body-dependent middleware behavior is unavailable. Vercel says this avoids sending the body to both middleware and the target function, which would add cost and time to first byte.

## Why it matters if you build agents

Agents that accept file uploads or large payloads can now send bodies up to 20MiB to Vercel Functions without hitting the old 4.5MB cap, once the project is opted in and set to 4GB memory.

If your middleware reads the request body, it will not see it after opting in, so move that logic into the function itself. Edge runtime routes will still return 413 for large bodies unless they move to the Node.js runtime.

When handling larger bodies, read them promptly and avoid holding them in memory to prevent backpressure and memory issues.
