Vercel 413 FUNCTION_PAYLOAD_TOO_LARGE with Sume video
Vercel Functions cap request and response bodies at 4.5 MB. Do not proxy a generated video through one; hand the client the media.sume.com URL instead.

Vercel returns 413: FUNCTION_PAYLOAD_TOO_LARGE when a Function's request or response body exceeds 4.5 MB. A generated video is usually bigger, so do not stream it back through a Function; return the Sume media URL from the job result and let the browser fetch it directly.
The limit is from Vercel's Functions limitations page (updated 2026-08-24), read 2026-09-30. Sume behavior is from Jobs and results and Media inputs.
What exactly does Vercel limit?
The page says the maximum payload size for the request body or the response body of a Vercel Function is 4.5 MB, and a larger payload returns 413 FUNCTION_PAYLOAD_TOO_LARGE. It applies in both directions, so it hits an upload through your route and a download through your route.
What does a Sume result give me instead of bytes?
Results carry a hosted URL. A webhook payload's artifact looks like { "id": "artf_...", "url": "https://media.sume.com/artifacts/...", "type": "image", ... }. The docs say to use Sume media URLs from the result, that Sume mirrors generated outputs into Sume-owned media URLs, and that integrations should store the Sume URL. So your route can return a few hundred bytes of JSON.
| Approach | Body size through the Function | Risk |
|---|---|---|
| Proxy the video bytes | The whole file | 413 above 4.5 MB |
| Return the Sume artifact URL | A short JSON field | None from this limit |
| Browser fetches the URL | Nothing | Store your own copy if you need long-term retention |
What about sending big inputs to Sume?
Inputs go in as public HTTPS URLs in fields such as input.image_url or video_url, and the docs say no separate upload step is needed for normal integrations. So you do not need to push a large file through a Function either. See downloading a generated video from the API for saving the file.
Does Sume also have a request size limit?
Yes, separately: the error table lists 413 payload_too_large when the request body exceeds the configured API limit. That is about your JSON request to Sume, which should be small when you pass URLs.
Sources
Related posts
More in Developers
- AI SDK addToolOutput clears approval: Sume idempotency_key
AI SDK 7.0.126 clears tool approvals when addToolOutput runs. If a paid Sume call replays, a stable idempotency_key is what guards the create.
- AI SDK SSE heartbeat vs Sume jobs_wait 55s slices
AI SDK 7.0.123 adds optional SSE heartbeats for idle UI streams. Sume's jobs_wait is capped at 55s per call, so you still repeat it with the same ids.
- Vercel Queues retry can resubmit a paid Sume job
A Vercel Queues consumer that times out is redelivered, and maxDeliveries is unlimited by default. Reuse one Idempotency-Key per message so Sume bills once.
- Vercel rewrite to an external API times out at 120 seconds
Vercel proxied rewrites to an external destination time out at 120 seconds with ROUTER_EXTERNAL_TARGET_ERROR. A Sume async submit returns at once.
Written by Sume