Skip to content

Anthropic

Claude API raises the request cap from 32 MB to 128 MB

5 min read

Our AI analyst checked this story itself: it ran, measured and compared against the originals. What we checked

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude prices and limits →
Video: x.com

Anthropic on October 29 raised the maximum request size on its own Claude API from 32 MB to 128 MB for the Messages and Token Counting endpoints. It also raised the per-image limit for requests with more than 20 images from 2,000 px to 3,000 px. If your app sends long computer-use sessions or big PDFs straight to Anthropic, those requests now get about four times the room. Through Bedrock or another cloud platform the cap is still 20 to 32 MB, and our reading of the Claude Code 2.1.314 code shows it still enforces 32 MiB by default.

The new figures are in Anthropic’s API documentation. It lists the other caps as 256 MB for the Message Batches API, 500 MB for the Files API and 32 MB for the beta Sessions, Agents and Environments endpoints. A request over its limit gets a 413 request_too_large error.

Which platform gets what

The 128 MB applies only to the first-party API. Anthropic’s announcement put cloud platforms “between 20 and 32 MB”, and the docs give the exact caps. Amazon Bedrock limits requests to 20 MB and Claude Models on Google Cloud (Google managed) to 30 MB. Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed) and Microsoft Foundry accept Messages and Token Counting requests of up to 32 MB. So the three Anthropic-operated cloud platforms now sit exactly where the first-party API was before the change.

Why sessions hit 32 MB early

The cap counts bytes, and it is separate from the token context window. A screenshot costs few tokens but a lot of bytes, so a session could sit well inside its context window and still be refused. That is the case Anthropic names: long computer-use sessions and big PDFs. Claude Code sends the whole conversation on every turn, so every screenshot read earlier in a session goes out again with each new request.

Our arithmetic puts a number on the gap. Claude Code caps each image at 5,242,880 bytes in base64. At that size a 32 MiB request holds at most 6 images and a 128 MiB request at most 25. Those 25 images cost at most 39,200 visual tokens on standard-tier models, or 119,600 on the high-resolution tier used by Claude 4.7 and later. That is an upper bound for maximum-size images, not a typical screenshot.

More than 20 images

Anthropic’s vision docs spell out the conditions on the 3,000 px rule. In a request with more than 20 image and document blocks, an image over 3,000 px on either side is rejected outright with an invalid_request_error. Screenshots returned in tool_result blocks count toward the 20, and so do earlier images resent with the conversation. On Bedrock and Claude Models on Google Cloud (Google managed), PDF document blocks count too. Each image also has a byte cap: 10 MB base64-encoded on the Claude API and on Google-managed Google Cloud, 5 MB on Bedrock. To stay under the limit on every platform, the docs say to keep each image within 3,000 px per side or keep the request to 20 or fewer image and document blocks.

Claude Code’s own cap

Claude Code 2.1.314 was published at 00:12 UTC on October 30, after the announcement, and it still sets a 32 MiB request cap as its default. The cap is read from a remote config flag, and that flag can only raise it. So whether a Claude Code user gets the new headroom depends on a server-side setting we cannot see. We found this in the code; we did not measure it at runtime. The same release also shrinks images to 2,000 px per side for every provider, first-party included, unless a second remote flag lifts that limit. By default, then, it does not use the 3,000 px allowance either.

When a conversation is too big, the code sorts it into one of three cases: media it can strip before retrying, a conversation it can compact, and one whose text alone is over the limit. The last case fails once with a message. Through a proxy, a gateway or a cloud provider, Claude Code shows a general error instead, because it cannot measure what the other side counted.

Our analysis

What we checked

On October 30 we sent unauthenticated POST requests of fixed sizes to the first-party API, one run per size, and read the shipped code of Claude Code 2.1.314.

How we check stories

The API matches the new docs, and the limit is exact: 128 MiB, inclusive. The client is where the old limit remains. Claude Code still defaults to 32 MiB and 2,000 px images, so a Claude Code user may see no change until the server-side flag raises it.

EndpointBodyResponse
/v1/messages134,217,728 bytes (128 MiB)401, missing key
/v1/messages134,217,729 bytes413 request_too_large
/v1/messages/count_tokens120 MB / 130 MB401 / 413
/v1/sessions31 MB / 40 MB401 / 413
/v1/agents40 MB413
  • A 401 means the body passed the size check and failed only on authentication.
  • Every 413 came back with server: cloudflare and no request-id, after curl had uploaded only about 160 KB of the body. Every 401 carried a request-id. From these headers we infer that the edge rejects oversized requests before authentication and before reading the body.
  • We did not probe /v1/environments.

If a request still fails

In Claude Code, the usual fix is /compact, which summarizes the conversation and drops the images and attachments it has collected. Pressing Esc twice steps back, and /clear starts over. For a large file, give Claude its path instead of pasting it into the conversation.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.