Which Request Size Limit Hits First Between Your App and Claude - Claude API, Bedrock, Claude Platform on AWS, API Gateway, and Lambda

First Published:
Last Updated:

In the release notes dated October 28, 2026, Anthropic increased the request size limits for the Messages API and Token Counting API of the first-party Claude API from 32 MB to 128 MB. This increase applies only to the first-party Claude API. Anthropic’s API overview page states that other platforms have their own separate limits.

When building an application on AWS, requests must pass through several layers before reaching Claude, including Amazon API Gateway, AWS Lambda, Application Load Balancer (ALB), and the Amazon Bedrock API. Each layer has its own limits. The layer with the smallest limit on the path determines the maximum size of a single request that can pass through. For example, when calling Claude from a browser through API Gateway and Lambda, the 6 MB limit for Lambda’s synchronous invocations will be reached before Claude’s 128 MB limit. When calling Lambda from ALB, the 1 MB limit applies.

Furthermore, each layer specifies its limits in different ways, including the company and page where the information is documented, and the units used. For instance, the 20 MB value for Bedrock is mentioned on Anthropic’s documentation page, but this value is not found in AWS documentation. AWS’s InvokeModel API reference states a limit of 25000000 for the body length, but does not specify the units.

This article aims to present a table and diagrams outlining the limits for each layer within a given path, along with references to the corresponding company and page where these values are documented. For what comes back when a limit is exceeded, it separates what the documentation states from what this article could not find in it. This article is not a comprehensive list of all limits, nor is it a guide for sending large files. Pricing information is not included. The information presented was verified on November 5, 2026.

On November 4, 2026 (UTC), using a validation account in the us-east-1 region, a Lambda function was deployed that simply returns the size of the received request. This function was placed behind an HTTP API, a REST API, and a function URL, and requests of sizes just below and above the 6 MB and 10 MB thresholds were sent. No models were invoked. Chapter 11 describes the results.

Related articles on this site:

Table of Contents

  1. 1. Scope and Assumptions
  2. 2. How to Read the Tables
  3. 3. Paths and Layers
  4. 4. Limits on the Claude Side
  5. 5. Limits on the AWS Side
  6. 6. The Effective Limit on Each Path
  7. 7. What Comes Back When a Limit Is Exceeded
  8. 8. Limits on the Response Side and Limits That Are Not Bytes
  9. 9. Sending Large Inputs Another Way
  10. 10. Where Sources Disagree, What the Documentation Does Not List, and Statements Not Found
  11. 11. Observations from This Configuration
  12. 12. Failure Modes
  13. 13. Frequently Asked Questions About Request Size Limits Between Your App and Claude
  14. 14. Summary
  15. 15. References

1. Scope and Assumptions

This chapter defines the intended audience for this article, outlines the scope of its content, specifies the date when the source materials were verified, and establishes the terminology used.

1.1 Intended Audience

This article is intended for developers and architects who are building applications that send large PDFs, images, or lengthy documents to Claude, hosted on AWS.

It is intended in particular for readers who think the following:

  • With Claude's limit now increased to 128 MB, it's possible to send data up to that size even when using API Gateway and Lambda.
  • Bedrock's Claude also has the same 128 MB limit.
  • By using response streaming, it's possible to handle larger requests.

Using statements in the documentation, this article shows that none of these three holds on every path.

1.2 Scope of Coverage and Exclusions

This article will cover the following topics:

  • Limits on request size for the first-party Claude API and non-first-party platforms, and what each limit covers.
  • Limits for each layer within AWS, specifying whether the limit applies to requests or responses, and the units of measurement.
  • Effective limits for each path.
  • What comes back when limits are exceeded, differentiating between information found in the documentation and observations from Chapter 11.
  • Limits on the response side, and limits that are not byte counts (the number of images, the number of documents, the number of PDF pages).
  • When sending large inputs using alternative methods, the available paths and functionalities (based solely on the documentation).
  • Differences in where each value is written, and statements not found.

This article does not cover the following topics:

1.3 Verification Date and Materials

This article checked the documentation on November 5, 2026. The stated limits may be subject to revision. As noted in Section 4.2, Anthropic's API overview page also advises users to verify the latest values with the relevant documentation for non-first-party platforms.

This article refers to Anthropic's materials under the following names:

  • API Overview Page: Claude API Overview Page (includes the "Request Size Limits" section).
  • Error Page: Claude API Error Page.
  • Release Notes: Claude Platform Release Notes.
  • Vision Page: Vision Page.
  • PDF Page: PDF Support Page.
  • Files API Page.
  • Bedrock Page: Claude in Amazon Bedrock (Opus 4.7 and later).
  • Legacy Bedrock Page: Claude on Amazon Bedrock (Opus 4.6 and earlier).
  • Platform on AWS Page: Anthropic's documentation for Claude Platform on AWS.
  • Message Threads Page.

This article refers to AWS documentation under the following names:

  • InvokeModel API reference. The API reference for InvokeModelWithResponseStream also uses the same value for the body.
  • Message API reference: A page detailing the Message type used in Converse.
  • Bedrock Messages API page: A page on using the Anthropic Messages API for inference.
  • Bedrock model card: A model card for Claude Opus 5.5.
  • Bedrock limits page: A page detailing the limits for Amazon Bedrock, as well as separate pages for bedrock-runtime and bedrock-mantle limits.
  • API Gateway limits page: A page detailing limits for REST API, HTTP API, and WebSocket API.
  • Gateway response page: The page on the gateway response types for REST APIs.
  • Response transfer mode page: The page on response streaming in API Gateway.
  • Lambda limits page.
  • Invoke API reference.
  • Function URL page: A page on using response streaming with Function URLs, and a page on calling Function URLs.
  • ALB Lambda target page and ALB troubleshooting page.
  • CloudFront limits page.
  • Claude Platform on AWS user guide: The Claude Platform on AWS user guide from AWS documentation.

1.4 Terminology

This article uses the following terms with the following meanings:

  • First-Party Claude API: The Claude API provided directly by Anthropic. Anthropic’s documentation refers to this as the first-party Claude API.
  • Non-first-party platforms: Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud, and Microsoft Foundry. The API overview page calls Bedrock and Claude Models on Google Cloud (Google managed) partner-operated platforms. Anthropic operates Claude Platform on AWS, and AWS handles authentication and billing (Platform on AWS page).
  • Path: The route from the application to Claude. This article assigns names to the paths in Chapter 3.
  • Layer: A component in the path that has a defined limit. This includes API Gateway, Lambda, ALB, CloudFront, Bedrock APIs, and Claude APIs.
  • Effective Limit: The lowest limit within a path.
  • Request and Response: Unless otherwise specified, the limits discussed in this article refer to the limits on the request side. The limits on the response side will be addressed in Chapter 8.
  • Request Body: The body of an HTTP request. body of InvokeModel is the name of a parameter in the API, and this article uses code formatting to distinguish it.
  • bedrock-runtime and bedrock-mantle: Bedrock inference endpoints. The APIs that these two endpoints accept are covered on this site's Amazon Bedrock Inference Endpoints and API Keys page.

2. How to Read the Tables

This chapter defines the columns in the tables presented in this article, as well as how to describe the condition of the materials and how to cite the source of the values. The columns in the summary table, presented in Chapter 3, are used consistently across the three articles in this series.

2.1 Table Columns

The summary table in Section 3.4 has the following seven columns:

  • Layer: The layer being referenced in that row.
  • Limit or Control: The limit of that layer and what it covers.
  • Set By: The company that defines this upper limit.
  • What Happens at the Boundary: How requests exceeding this limit are handled.
  • How You Can Tell: Where you can verify that the limit has been reached.
  • Where It Is Written: The source of the information for that row.
  • Source State: The condition of the material, described using the terminology from Section 2.2.

The table in Section 5.7, which details the layers, uses this article's own columns: Layer, Limit, Unit as Written, Direction, What Happens When Exceeded, Where It Is Written, and Source State. The Unit as Written column specifies the unit of measurement as stated in the material, while the Direction column indicates whether the limit applies to the request side or the response side.

2.2 Terms for the State of the Sources

This article uses eight terms to describe the state of the documentation. These English terms will also be used in the tables.

  • Stated: The documentation contains a statement regarding the matter.
  • Stated as not supported: The documentation explicitly states that the matter is not supported or cannot be used.
  • Documentation does not list: While a list or table exists, the specific item is not included. This does not necessarily indicate that the matter is unsupported or unavailable.
  • Not recorded (stated): The documentation states that the information is not included in logs or records.
  • No statement found: Despite searching using different search terms and examining different categories of documentation, no relevant statement could be found. This does not indicate that the matter is absent or that there is no limit.
  • Sources disagree: The statements in two different documents regarding the same matter are contradictory. This article presents both statements and their sources and does not decide that either is wrong.
  • Inference: An inference of this article, not a statement in any of the sources. This article says so in the same sentence.
  • Observation: This refers to findings observed during testing, as described in Chapter 11. This is not a promise in the documentation. This article does not override statements in the sources with observations.

This article does not merge Stated as not supported and No statement found. The former is a statement in the sources; the latter means that this article could not find a statement.

2.3 How to Indicate the Source of Values

This article will indicate which company's documentation provides each value, in the same sentence. Values from Anthropic's documentation will be presented as values stated in Anthropic's documentation, and values from AWS documentation will be presented as values stated in AWS documentation. For example, the 20 MB value for Bedrock will be presented as a value stated in Anthropic's documentation, and not as an AWS specification.

When Anthropic's documentation and AWS documentation provide different values for the same subject, this article does not call them Sources disagree right away. It first checks whether the two values limit the same thing. For example, this could refer to the total request size, the length of an API parameter, or the size of a single image. If it is not possible to align them, the two values will be presented side-by-side, along with their respective sources.

2.4 Formatting Units

This article will present units as they appear in the source documentation. The specific formatting of units varies by document, as detailed below.

The documentation for Lambda’s limits states that MB is used to represent 1,024 KB.

The Lambda documentation, log messages, and console use the abbreviation MB (rather than MiB) to refer to 1,024 KB.

The documentation for the REST API gateway response indicates that when the limit is exceeded, the default message states 10485760 bytes (see Section 5.2). The documentation for API Gateway’s limits states the same limit as 10 MB.

No statement was found regarding how Anthropic uses the term MB. The API reference for InvokeModel lists 25000000 without specifying a unit.

This article will not convert MB to MiB. It will also not represent 25000000 as 25 MB.

3. Paths and Layers

This chapter lists the entry points that reach Claude and the layers placed in front of them, and names each path. It then gives a summary table that uses the columns shared by the three articles in this series.

3.1 Five Entry Points That Reach Claude

Within the scope of this article, there are five entry points for calling Claude from an application server.

  • Claude API: The first-party Claude API.
  • Claude Platform on AWS: A Claude API accessible through your AWS account, operated by Anthropic.
  • bedrock-runtime in Bedrock: InvokeModel and Converse.
  • bedrock-runtime in Bedrock: Messages API.
  • bedrock-mantle in Bedrock: Messages API.

The decision to categorize Bedrock's entry points into three is based on AWS documentation, which states that the Messages API for Claude is accepted on two endpoints. The Bedrock Messages API page states:

You can use the Messages API on both the bedrock-runtime and bedrock-mantle endpoints.

A table on the same page indicates that the bedrock-runtime entry point is recommended for new applications, providing the following URL.

https://bedrock-runtime.{region}.amazonaws.com/anthropic

The table on the Claude Opus 5.5 model card within Bedrock lists Messages, Converse, and Invoke as accessible through bedrock-runtime, while only Messages is listed as accessible through bedrock-mantle.

Anthropic's documentation presents a different categorization for Bedrock. The Bedrock page describes using the /anthropic/v1/messages Messages API for models Opus 4.7 and later. The legacy Bedrock page, whose title says "Opus 4.6 and earlier," describes using InvokeModel and Converse. The same page also states that newer models, including Claude Opus 5.5 and Claude Opus 4.7, are reachable through InvokeModel on bedrock-runtime. This article will categorize entry points according to the AWS documentation and will, for each statement in Anthropic's documentation, identify which entry point it refers to. The differences between Bedrock's entry points and the transition between API versions are also discussed in this site's Moving a Claude Integration to API Version 2026-10-21 on AWS.

3.2 Layers in Front of the Claude-Side Entry Point

When receiving files from browsers or mobile applications, this article discusses configurations that place one of the following layers in front of Claude's entry point.

  • Calling Lambda functions synchronously from an API Gateway REST API or HTTP API.
  • Calling Lambda functions from an API Gateway's WebSocket API.
  • Calling Lambda functions from an Application Load Balancer (ALB).
  • Directly calling functions using a Lambda function URL.

Amazon CloudFront can be placed in front of any of these layers. The Lambda functions then create and send requests to Claude's entry point based on the received requests.

3.3 Path Names

This article refers to the paths using the following names:

PathFront LayersClaude-Side Entry
P1None (Directly from the application server)Claude API
P2None (Same as above)Claude Platform on AWS
P3None (Same as above)Bedrock's bedrock-runtime InvokeModel and Converse
P4None (Same as above)Bedrock's bedrock-runtime Messages API
P5None (Same as above)Bedrock's bedrock-mantle Messages API
F1API Gateway REST API or HTTP API, Lambda (Synchronous)Any of P1 through P5
F2API Gateway WebSocket API, LambdaAny of P1 through P5
F3ALB, LambdaAny of P1 through P5
F4Lambda Function URLAny of P1 through P5

Even if CloudFront is placed before paths F1 through F4, in the scope of this article, the effective limit remains unchanged, except when field-level encryption is configured (see Section 5.5).

The following diagram lists the layers of each path from left to right, and indicates the lowest layer for each path.

Which Request Size Limit Hits First on Each Path
Which Request Size Limit Hits First on Each Path

3.4 Summary Table

The following table lists, for each layer, the limit, how a request over the limit is handled, and where the value is written.

LayerLimit or ControlSet ByWhat Happens at the BoundaryHow You Can TellWhere It Is WrittenSource State
Claude APIMessages and token counting are limited to 128 MB. Message batches are limited to 256 MB, Files API to 500 MB, and Sessions, Agents, and Environments to 32 MB.AnthropicA request_too_large (413) error is returned. On the first-party Claude API, Cloudflare returns the error before the request reaches the API server.HTTP status and error typeAPI overview page, error pageStated
Claude Platform on AWSMessages and token counting are limited to 32 MB.Operated by Anthropic. The value is written in Anthropic's documentation.No documentation was found describing what happens when the limit is exceeded.—API overview pageStated in Anthropic's documentation. No statement found in AWS documentation.
Amazon BedrockAnthropic's documentation states 20 MB. AWS documentation specifies an upper limit of 25000000 for the length of the body in InvokeModel (unit unspecified). For Converse, the limit is 20 images (3.75 MB per image) and 5 documents (4.5 MB per document).Operated by AWS. The values are written in Anthropic's documentation and in AWS documentation.AWS documentation states that input that fails to satisfy the constraints returns a ValidationException (HTTP 400). No documentation was found describing what happens when the size limit is exceeded.—API overview page, legacy Bedrock page, InvokeModel and Message API referenceEach value is Stated. A limit per entry point: No statement found.
API Gateway REST and HTTP APIsPayload is limited to 10 MB, and cannot be increased.AWSREST APIs return a REQUEST_TOO_LARGE (413) gateway response.HTTP status and default messageAPI Gateway limits page, gateway response pageStated for REST APIs. What HTTP APIs return: No statement found. Observation in Chapter 11.
API Gateway WebSocket APIMessages are limited to 128 KB, and frames to 32 KB.AWSThe connection is closed with code 1009.WebSocket close codesAPI Gateway limits pageStated
Lambda invocationSynchronous invocation requests and responses are each limited to 6 MB. Streaming responses are limited to 200 MB. Asynchronous invocations are limited to 1 MB.AWSThe Invoke API returns a 413 exception.Exception nameLambda limits page, Invoke API referenceStated. No statement found regarding which 413 exception is returned. In Chapter 11, the Invoke API returned a different exception name, RequestEntityTooLargeException (Observation).
Lambda function URLWith BUFFERED, the limit is 6 MB. With RESPONSE_STREAM, the response is limited to 200 MB.AWSNo documentation was found describing what happens when the limit is exceeded.—Function URL pageValue stated. No statement found regarding handling when the limit is exceeded. See Chapter 11 for observations.
ALB to LambdaThe request body sent to Lambda is limited to 1 MB. The JSON response Lambda can return is limited to 1 MB.AWSAn HTTP 413 error is returned.HTTP statusALB Lambda target page, ALB troubleshooting pageStated
CloudFrontHTTP request body is limited to 64 GB.AWSNo documentation was found describing what happens when the limit is exceeded.—CloudFront limits pageValue stated

4. Limits on the Claude Side

This chapter lists the limits outlined in Anthropic's documentation. Even within Anthropic's documentation, the limits of the first-party Claude API and the limits of non-first-party platforms are separate statements.

4.1 First-Party Claude API

The overview page for the API outlines the limits for the first-party Claude API, as shown in the following table:

EndpointMaximum Request Size
Messages, Token Counting128 MB
Message Batches API256 MB
Files API500 MB
Sessions, Agents, Environments32 MB

Immediately following the table, the overview page states that requests exceeding these limits will return a 413 request_too_large error. The error page explains that a 413 request_too_large error indicates that the request size exceeded the allowed number of bytes. The same page then states that Cloudflare returns this error, and limits that statement to the first-party Claude API.

If you exceed these limits, you’ll receive a 413 `request_too_large` error. On the first-party Claude API, Cloudflare returns this error before the request reaches the API servers.

The limits table on the error page includes rows for the Messages API, Token Counting API, Batch API, and Files API, but does not include rows for Sessions, Agents, and Environments. This article will use the table from the API overview page. The meaning of the 413 error and how to handle it are covered in the 413 section of Anthropic Claude API Errors Reference on this site.

4.2 Non-First-Party Platforms

The API overview page gives the limits for non-first-party platforms in the note after the limits table.

Partner-operated platforms have their own request size limits: Bedrock limits requests to 20 MB, and Claude Models on Google Cloud (Google managed) limits requests to 30 MB. Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), and Microsoft Foundry support Messages and Token Counting requests of up to 32 MB. Consult your platform’s documentation for current values.

Three points follow from this note:

  • The first sentence lists Bedrock and Claude Models on Google Cloud (Google managed) as partner-operated platforms, and gives 20 MB for Bedrock and 30 MB for Google managed. It does not say which Bedrock entry point the value is for.
  • The 32 MB mentioned in the second sentence refers to Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), and Microsoft Foundry, specifically for Messages and Token Counting. The note does not list values for Message Batches and Files API (Documentation does not list).
  • The third sentence advises users to verify the latest values in the documentation of each platform.

The 20 MB limit for Bedrock is also mentioned on the legacy Bedrock page, the page for the integration that uses InvokeModel and Converse. The 20 MB sentence follows a model list that includes newer models such as Claude Opus 5.5.

Bedrock limits request payloads to 20 MB. When sending large documents or many images, you might reach this limit before the token limit.

No statement regarding the maximum request size was found on the Bedrock page for Opus 4.7 and later models.

The 32 MB limit for Claude Platform on AWS is a value in Anthropic's documentation. No statement regarding the maximum request size was found in the AWS documentation for Claude Platform on AWS. The Rate limits and quotas page of that user guide has the following sentence.

Claude Platform on AWS uses Anthropic’s standard tier schedule, identical to the first-party Claude API.

This sentence relates to rate limits. This article does not expand upon this sentence to mean that the maximum request size is the same as that of the first-party Claude API.

4.3 128 MB Is the Value for the First-Party Claude API

The release notes from October 28, 2026, specify this increase only for the first-party Claude API.

We’ve raised the maximum request size for the Messages API and the Token Counting API from 32 MB to 128 MB on the first-party Claude API.

The vision page and the PDF page also state that 128 MB is the value for the first-party Claude API. The vision page states:

Although the API supports up to 600 images for each request, request size limits can be reached first. The limit is 128 MB on the first-party Claude API, and other platforms have their own limits.

The table on the PDF page lists 128 MB in the Maximum request size row as the first-party Claude API value, and says that it varies by platform. None of the three pages list 128 MB as a value for any platform other than the first-party Claude API.

5. Limits on the AWS Side

This chapter outlines the limits described in AWS documentation, organized by layer. A table summarizing these limits by layer is provided in Section 5.7.

5.1 Amazon Bedrock

The InvokeModel API reference specifies length constraints in the request's body. The InvokeModelWithResponseStream API reference also gives the same value for body.

Length Constraints: Minimum length of 0. Maximum length of 25000000.

This value of 25000000 does not include a unit of measurement. body is the parameter that carries the JSON request body for the model. This article does not write this value as 25 MB.

The Message API reference specifies limits for images and documents in the Message content for Converse.

You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively. You can include up to five documents. Each document's size must be no more than 4.5 MB.

The pages detailing limits for bedrock-runtime and bedrock-mantle list limits such as the number of tokens per minute. However, this article could not find a section detailing the size of inference requests in the Amazon Bedrock limits page, nor in these two pages, nor in the Amazon Bedrock quotas page of the AWS General Reference (No statement found). The model card for Claude Opus 5.5, in its "Quotas and Limits" section, only references the Bedrock limits page and does not specify a size value.

In summary, based on the information found in AWS documentation regarding Claude within Bedrock, the only values identified for the size of requests are those listed for the body length in InvokeModel and InvokeModelWithResponseStream, as well as the limits for images and documents within Converse. No AWS documentation was found specifying the size of requests for the Messages API within bedrock-runtime and bedrock-mantle. This does not indicate the absence of a limit. Anthropic's API overview page states that Bedrock has a limit of 20 MB.

5.2 API Gateway

The REST API limits page and the HTTP API limits page both state a maximum payload size of 10 MB, which cannot be increased. The AWS General Reference page for API Gateway also specifies a maximum API payload size of 10 Megabytes, describing it as the maximum payload size for all APIs except WebSocket APIs.

The gateway response page for REST APIs sets the default status code for the REQUEST_TOO_LARGE error type to 413 and includes the following default message:

REQUEST_TOO_LARGE 413 The gateway response for the request too large error. If the response type is unspecified, this response defaults to: HTTP content length exceeded 10485760 bytes .

This page is in the REST API chapter. No statement was found on what an HTTP API returns when a request exceeds 10 MB (No statement found).

The WebSocket API limits page specifies a maximum message payload size of 128 KB and a maximum frame size of 32 KB. The note accompanying the message payload row states:

Because of the WebSocket frame-size quota of 32 KB, a message larger than 32 KB must be split into multiple frames, each 32 KB or smaller. This applies to @connections commands. If a larger message (or larger frame size) is received, the connection is closed with code 1009.

5.3 Lambda

The page detailing Lambda limits specifies the maximum payload size for invocations, using the following three values:

6 MB each for request and response (synchronous)
200 MB for each streamed response (synchronous)
1 MB (asynchronous)

The Invoke API reference also documents the maximum payload size for both synchronous and asynchronous invocations.

For synchronous invocations, the maximum payload size is 6 MB. For asynchronous invocations, the maximum payload size is 1 MB.

The page regarding function URLs lists the following values, depending on the invocation mode. When using BUFFERED, Lambda invokes the function via the Invoke API. When using RESPONSE_STREAM, Lambda invokes the function via the InvokeWithResponseStream API.

The maximum payload size is 6 MB.
The maximum response payload size is 200 MB.

The first line refers to the BUFFERED mode, and the second line refers to the RESPONSE_STREAM mode. No statement was found directly specifying the maximum size for requests related to function URLs. This article reads the 6 MB synchronous limit of the Invoke API as applying in BUFFERED mode (Inference).

5.4 ALB

The ALB Lambda target page limits both the request body sent to a Lambda function and the response JSON that the function returns to 1 MB.

The maximum size of the request body that you can send to a Lambda function is 1 MB.

The same page states that the load balancer Base64-encodes the body when the content-encoding header is present, or when the content type is not one of the types it sends as is. No statement was found on whether the 1 MB is measured before or after this encoding (No statement found).

The ALB troubleshooting page lists the following as one potential cause of HTTP 413 errors:

The target is a Lambda function and the request body exceeds 1 MB.

5.5 CloudFront

The table on the limits page for CloudFront specifies a maximum size of 64 GB for the HTTP request body. The description in that row is the following:

Maximum size of an HTTP request body.

64 GB exceeds the limits for any layer discussed in this article. Placing CloudFront in front does not lower the effective limit of any path in this article, unless field-level encryption is configured: the same page lists 1 MB as the maximum length of a request body when field-level encryption is configured, a configuration this article does not examine. Note that the custom origin page for CloudFront indicates that if a viewer's GET request includes a body, CloudFront will return a 403 error.

5.6 When Step Functions Is in the Path

When integrating AWS Step Functions between a Lambda function and the entry point for Claude, passing the request content as state input, the task, state, and execution input and output limits of Step Functions, which are 256 KiB, effectively create a smaller layer. This limit and methods for avoiding it are discussed in Chapter 6 of AWS Step Functions Orchestration Patterns for Generative AI on this site.

5.7 Table of Layers

The following table lists the limits of the layers in this article, as the sources write them.

LayerLimitUnit as WrittenDirectionWhat Happens When ExceededWhere It Is WrittenSource State
Claude API, Messages and Token Counting128MBRequest413 request_too_large. On the first-party Claude API, Cloudflare returns it.API overview page, error pageStated
Claude API, Message Batches API256MBRequest413 request_too_largeAPI overview pageStated
Claude API, Files API500MBRequest413 request_too_largeAPI overview pageStated
Claude API, Sessions, Agents, Environments32MBRequest413 request_too_largeAPI overview pageStated
Claude Platform on AWS, Messages and Token Counting32MBRequestNo statement foundAPI overview page (Anthropic's documentation)Anthropic's documentation: Stated. AWS documentation: No statement found.
Bedrock, per Anthropic's documentation20MBRequestNo statement foundAPI overview page, legacy Bedrock page (Anthropic's documentation)Anthropic's documentation: Stated. Which entry point: No statement found.
Bedrock InvokeModel body25000000(No unit specified)RequestValidationException (HTTP 400) – a general error for input that doesn't meet the constraints.InvokeModel API reference (AWS documentation)Stated
Bedrock Converse images20 images, 3.75 MB per image, 8000 pxMB, pxRequestNo statement foundMessage API reference (AWS documentation)Stated
Bedrock Converse documents5 documents, 4.5 MB per documentMBRequestNo statement foundMessage API reference (AWS documentation)Stated
Bedrock Messages API (bedrock-runtime and bedrock-mantle)Value not found—RequestNo statement found—No statement found
API Gateway REST API payload10MB. Default message is 10485760 bytesRequest413 REQUEST_TOO_LARGEREST API limits page, Gateway response pageStated
API Gateway HTTP API payload10MBRequestNo statement foundHTTP API limits pageValue is Stated
API Gateway WebSocket API message128 (32 per frame)KBRequestConnection is closed with code 1009WebSocket API limits pageStated
Lambda synchronous invocation6MB (equivalent to 1,024 KB)Request and responseInvoke API returns a 413 exceptionLambda limits page, Invoke API referenceStated
Lambda streamed response200MBResponseNo statement foundLambda limits pageStated
Lambda asynchronous invocation1MBRequestNo statement foundLambda limits page, Invoke API referenceStated
Lambda function URL, BUFFERED6MBPage refers to payloadNo statement foundFunction URL pageStated
Lambda function URL, RESPONSE_STREAM200MBResponseNo statement foundFunction URL pageStated
ALB to Lambda request body1MBRequestHTTP 413ALB Lambda target page, ALB troubleshooting pageStated
ALB from Lambda response JSON1MBResponseNo statement foundALB Lambda target pageStated
CloudFront HTTP request body64GBRequestNo statement foundCloudFront limits pageStated

6. The Effective Limit on Each Path

This chapter lists, for each path in Chapter 3, the layer with the smallest limit. It then details the size to which Lambda's 6 MB applies, and specifies the upper limits that take effect when a file does not go through the front layers.

6.1 Path Table

The following table lists, for each path in Section 3.3, the smallest layer, its value, and the source of that value.

PathSmallest LayerEffective Limit as WrittenWhere It Is WrittenSource State
P1Claude API128 MB (Messages and Token Counting)API overview pageStated
P2Claude Platform on AWS32 MB (Messages and Token Counting)API overview page (Anthropic's documentation)Anthropic's documentation: Stated. AWS documentation: No statement found.
P3BedrockAnthropic's documentation: 20 MB. AWS documentation: 25000000 (length of body, unit not specified).API overview page, legacy Bedrock page, InvokeModel API referenceEach value: Stated. Which applies first: No statement found.
P4Bedrock20 MB (Anthropic's documentation, in a sentence that does not distinguish Bedrock entry points).API overview pageAnthropic's documentation: Stated. AWS documentation: No statement found.
P5BedrockSame as P4API overview pageSame as P4
F1Lambda synchronous invocation6 MB (size of the event that Lambda receives)Lambda limits pageStated
F2API Gateway WebSocket API128 KB (per message)WebSocket API limits pageStated
F3ALB Lambda Target1 MB (request body)ALB Lambda target pageStated
F4Lambda Function URL (BUFFERED)6 MBfunction URL page, Invoke API referenceValue: Stated. Applying it to the request side: Inference. See Chapter 11 for Observation.

This article reads the two values for P3 as follows. If 25000000 is a number of bytes, 20 MB is smaller whether MB is read as 1,000,000 bytes or as 1,048,576 bytes (Inference). However, the unit for 25000000 is not specified. Furthermore, these two values represent upper limits for different aspects: the total request size and the length of the body parameter. This article does not call the two values Sources disagree (Section 10.1).

On F1 through F4, whichever Claude-side entry point is used, the front layer's value is smaller. The 6 MB value for F1 is smaller than the 32 MB for P2, the 20 MB for P3 through P5, and the 128 MB for P1. The API Gateway limits page states that 10 MB cannot be increased. The Lambda limits page states that, except as noted, the quotas in the table that includes the invocation payload cannot be changed.

6.2 Lambda's 6 MB Is Not the Size of the Body

The 6 MB limit for Lambda refers to the maximum size of the payload that Lambda receives for an invocation. In API Gateway's Lambda proxy integration, Lambda receives the request body along with request headers, path, and other contextual information as a single JSON event. The Lambda integration page for HTTP APIs illustrates the structure of this event. Therefore, the size of the body that a client can send must be smaller than 6 MB (Inference).

When the body is encoded in base64, the size is further reduced. In REST APIs, API Gateway may encode binary bodies into base64 strings based on the list of binaryMediaTypes and the Content-Type header. Regarding HTTP APIs, an article on the AWS Compute Blog states that API Gateway infers from the content-type header whether to encode the body. Because base64 converts 3 bytes into 4 characters, a body encoded in base64 will be approximately 4/3 the size of the original. Given that Lambda's 6 MB limit is 6,291,456 bytes (Section 2.4), the original file that can fit in the 6 MB event must be smaller than 4,718,592 bytes, which is 3/4 of 6,291,456 bytes (Inference).

The units are also inconsistent. The Lambda limits page uses MB to refer to 1,024 KB. For REST APIs, the default message of the gateway response gives 10 MB as 10485760 bytes. Apart from this default message for REST APIs, this article has not checked how many bytes the 10 MB on the API Gateway limits page is.

In the configuration in Chapter 11, text bodies up to 6,280,000 bytes passed on the HTTP API, the REST API, and the function URL, and 6,300,000 bytes stopped. Binary bodies were encoded in base64; a 4,600,000-byte file passed, and a 4,800,000-byte file stopped (Observation).

6.3 When a File Does Not Go Through the Front Layers

In configurations where large files do not go through the front layers, the limits of those layers do not apply to the files. For example, consider a scenario where a client places a file in S3 using an Amazon S3 presigned URL, and a Lambda function reads the file from S3 and sends it to Claude (see Section 9.3).

In this case, the request that the Lambda function sends to the Claude-side entry point is not a Lambda invocation payload. Therefore, the 6 MB limit for Lambda does not apply to that request (Inference). Instead, Claude’s limits apply. For P1, this is 128 MB; for P2, it’s 32 MB; and for P3 through P5, it’s 20 MB, as specified in Anthropic’s documentation. The memory and execution time limits for the Lambda function are outside the scope of this article.

7. What Comes Back When a Limit Is Exceeded

This chapter details what is returned when a limit is exceeded, separating what the documentation states from what it does not. Observations from Chapter 11 are in a column separate from the documentation.

7.1 What Each Layer Returns

LayerWhat the Documentation SaysSource StateObservation in Chapter 11
Claude API413 request_too_large. On the first-party Claude API, Cloudflare returns this error before the request reaches the API server.StatedNot tested
Claude Platform on AWSNo documentation found describing how this is handled when the limit is exceeded.No statement foundNot tested
Bedrock InvokeModel and ConverseValidationException is an error indicating that the input does not meet Bedrock's constraints, and returns an HTTP 400 status. No statement was found that it is returned when a size limit is exceeded.General error: Stated. Size limit exceeded: No statement foundNot tested
Bedrock Messages APINo documentation found describing how this is handled when the limit is exceeded.No statement foundNot tested
API Gateway REST APIREQUEST_TOO_LARGE in the gateway response. The default status is 413.Stated6,300,000 to 10,485,760 bytes: 413 and Request Too Long. The x-amzn-errortype is BadRequestException. 10,490,000 bytes or more: 413 and the default message.
API Gateway HTTP APINo documentation found describing how this is handled when the limit is exceeded.No statement found6,300,000 bytes or more: 413 and Request Entity Too Large.
API Gateway WebSocket APIThe connection is closed with code 1009.StatedNot tested
Lambda Invoke APIRequestTooLargeException (HTTP 413) and SerializedRequestEntityTooLargeException (HTTP 413). No documentation was found specifying which exception is returned at which size.Exceptions: Stated. Which size returns which: No statement found6,300,000 bytes: 413 and RequestEntityTooLargeException. It is neither of the two exceptions in the documentation.
Lambda function URLNo documentation found describing how this is handled when the limit is exceeded.No statement found6,300,000 bytes or more: 413 and RequestEntityTooLargeException.
ALB to LambdaHTTP 413StatedNot tested

7.2 Lambda's 413 Exceptions

The Invoke API reference lists two HTTP 413 exceptions. The first is RequestTooLargeException, described as follows:

The request payload exceeded the Invoke request body JSON input quota.

The second is SerializedRequestEntityTooLargeException, described as follows:

The request payload exceeded the maximum allowed size for serialized request entities.

Both exceptions relate to the size of the request payload. This article does not mix these two exceptions with the size limit of a function's deployment package.

In the configuration in Chapter 11, the Invoke API returned RequestEntityTooLargeException, which is neither of the two, with HTTP 413 for a payload of 6,300,000 bytes (Observation). This article does not override the API reference with this observation. Code that checks only the names of these two exceptions will not catch this observed exception (Inference).

7.3 Records of Requests Stopped at a Front Layer

When a front layer stops a request, the Lambda function is not invoked. Consequently, no record of that request is saved in the Lambda function's logs (Inference).

An article in the AWS re:Post Knowledge Center lists 413 Request Entity Too Large errors among those that API Gateway might not record in the execution logs of a REST API. The same article recommends using CloudWatch access logs to investigate client-side errors. While the article does not explicitly state that a 413 error is returned when requests exceed 10 MB, this article references that article as a potential starting point for investigating 413 errors.

8. Limits on the Response Side and Limits That Are Not Bytes

This chapter outlines the upper limits on the response side, as well as limits that are not based on the number of bytes in the request. Both represent an additional layer of constraints beyond the maximum size of the request itself.

8.1 Streaming on the Response Side Only

The response transfer mode page explains the following regarding API Gateway's response streaming capabilities:

Response streaming is only supported for REST APIs. Request streaming isn't supported.

API Gateway's REST APIs can return responses exceeding 10 MB through response streaming. The same page states that bandwidth limitations are applied to responses after the initial 10 MB.

Within each streaming response, the first 10MB of response payload is not subject to any bandwidth restrictions. Response payload data exceeding 10MB is restricted to 2MB/s.

Lambda can return streaming responses up to 200 MB. The function URL's RESPONSE_STREAM also supports responses up to 200 MB. These limits apply only to the response side; the limits on the request side remain unchanged. API Gateway requests are still limited to 10 MB, and synchronous Lambda function call requests remain at 6 MB. For a function URL, no statement directly gives the request-side limit (Section 5.3). HTTP APIs do not support response streaming. No statement was found that ALB Lambda targets can stream responses (No statement found). The design for response streaming is covered in End-to-End Response Streaming Architecture for Generative AI on AWS on this site.

8.2 Image Count and Size

The vision page sets a maximum of 600 images per API request. For models with a 200k token context window, the limit is 100 images. The maximum dimensions for a single image are 8000 pixels in both height and width. When a single request includes more than 20 images, a stricter limit on width and height applies to every image. The vision page states that for Claude Models on Google Cloud (Google managed) and Amazon Bedrock, blocks of documents such as PDFs are also counted within this limit of 20.

Regarding the maximum size for a single image, the vision page specifies the following limits by platform:

10 MB (base64-encoded) on the Claude API and Claude Models on Google Cloud (Google managed).
5 MB (base64-encoded) on Amazon Bedrock.
10 MB on claude.ai.

This list does not include values for the Claude Platform on AWS and Microsoft Foundry (Documentation does not list).

The AWS documentation's Message API reference specifies a limit of 20 images per request, with a maximum size of 3.75 MB per image (Section 5.1). Anthropic's 5 MB is the size after base64 encoding. The request limits list names only "Amazon Bedrock," while the page's availability table gives the same note (a 5 MB per-image limit after base64 encoding and "a lower total request size" with no value) for both "Amazon Bedrock" and "Amazon Bedrock (InvokeModel)." The AWS documentation's 3.75 MB is the Converse value, and the page does not specify whether this is before or after base64 encoding. If the 3.75 MB were measured before encoding, 3.75 MB × 4/3 would be 5 MB (Inference). Neither page states this. Because the two values cannot be confirmed as limits on the same thing, this article does not call them Sources disagree (Section 10.1).

8.3 Document Count and PDF Page Count

The Message API reference specifies that Converse accepts up to five documents, each up to 4.5 MB.

The table on the PDF page sets the maximum number of pages per request at 600. However, if the request context window is smaller than 1 million tokens, the limit is reduced to 100 pages. The same page also notes that a request's context window may become full before reaching the maximum page limit.

8.4 Token Limit

Even within the byte limits, requests may still reach the model's context window limit. The 20 MB sentence on the legacy Bedrock page says that with large documents or many images, a request might reach 20 MB before the token limit (see Section 4.2). The LLM Token Counter and Context Budget Planner tool on this site provides estimates for token counts.

9. Sending Large Inputs Another Way

This chapter outlines the various methods for transmitting large inputs, and which path can use which, using only statements in the documentation. It does not detail the specific procedures.

9.1 Files API

The Files API allows you to upload files and then reference them using the file_id within requests to the Messages API. The Files API page specifies that files up to 500 MB can be uploaded; attempts to upload larger files will result in a 413 error. The vision page states that when sending many images, using the Files API to upload and reference them via file_id helps to keep the request payload smaller.

The Files API page lists the Claude API, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), and Microsoft Foundry (hosted on Anthropic) as platforms on which a Messages API request can refer to a file_id.

The PDF page states that even when using the Files API, large PDF requests may fail before reaching the page limit. While the Files API reduces the number of bytes in the request, it does not alter the limits on page count or context window size.

9.2 Bedrock's Claude

The Bedrock page in Anthropic's documentation lists the following item among the features not supported:

Input sources (URL sources for images and documents, Files API)

According to Anthropic's documentation, Bedrock's Claude does not support the Files API or URL sources for images and documents (Stated as not supported).

AWS documentation for Converse includes DocumentSource and ImageSource, which, in addition to bytes, also have an s3Location member. It directs users to another page to determine which models support uploads from S3. This article could not find a statement that Claude supports s3Location (No statement found).

9.3 Putting the File in S3 Without the Front Layers

An article on the AWS Compute Blog, published on March 21, 2025, discusses handling large payloads, stating:

If your payloads are tens of MBs or more, or you need to transport large binary objects with API Gateway, you can store the payload on Amazon Simple Storage Service (Amazon S3) and use pre-signed URLs for clients to directly upload and download from S3.

In this configuration, the file does not go through the API Gateway payload or the Lambda invocation payload. When the Lambda function reads the file from S3 and sends it to the Claude-side entry point, the Claude-side limit is what applies (Section 6.3). The blog article also gives other limit values, and some of them are older than the values on the current pages that this article checked. This article quotes only the sentence above from it.

9.4 Message Threads, Which Do Not Resend the Conversation

The release notes from November 2, 2026, indicate that Messages API's message threads are currently in beta. Using message threads allows the API to retain conversations on the server, so subsequent requests only send new messages. The release notes list Claude API, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), and Microsoft Foundry as platforms that support message threads. Bedrock is not in this list (Documentation does not list). While message threads help reduce the size of requests for lengthy conversations, they do not change the size limitations for images or documents that can be included in a single message (Inference).

10. Where Sources Disagree, What the Documentation Does Not List, and Statements Not Found

This chapter sorts what this article found by comparing the documentation into three groups.

10.1 For Bedrock, Different Values Are on Different Pages

The values found in this article, concerning the size of Bedrock requests for Claude, are located on the following pages:

  • Anthropic's API overview page: Bedrock limits requests to 20 MB. It does not say which Bedrock entry point the value is for.
  • Anthropic's legacy Bedrock page: The payload for Bedrock requests is 20 MB. This is the page for the integration that uses InvokeModel and Converse.
  • Anthropic's vision page: A single image processed through Bedrock, when encoded in base64, is 5 MB.
  • AWS InvokeModel API reference: The length of the body can be up to 25000000. The unit is not specified.
  • AWS Message API reference: Converse can handle 20 images, with each image being 3.75 MB, and 5 documents, with each document being 4.5 MB.
  • AWS Bedrock limits page and Messages API page: No values regarding the size of requests were found.

This article does not call this Sources disagree. These values represent different limits: the overall request size, the length of an API parameter, a single image, and a single document. No values regarding the overall request size were found in AWS documentation.

Where Each Bedrock Size Value Is Written
Where Each Bedrock Size Value Is Written
The 32 MB value for Claude Platform on AWS is only found on Anthropic's API overview page. No values regarding request size were found in AWS's Claude Platform on AWS user guide.

10.2 What the Documentation Does Not List

  • The notes on the API overview page do not list the Message Batches and Files API limits of Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), and Microsoft Foundry.
  • The list of image sizes on the vision page does not include information for Claude Platform on AWS and Microsoft Foundry.
  • The list of platforms for message threads does not include Bedrock.
  • The Bedrock limits pages that this article checked do not include an item for the size of inference requests.

None of these omissions indicate that these features are unavailable or unsupported.

10.3 Statements Not Found

This article lists items that were searched for three or more times using different search terms and sources of documentation, but no relevant statements were found (No statement found). This does not mean that there is no limit or that the thing does not happen.

  • A statement from AWS documentation specifying a 20 MB limit for requests to Claude within Bedrock.
  • The upper limit for the size of requests to the Messages API for bedrock-runtime and bedrock-mantle.
  • The unit of the value 25000000 for the body of InvokeModel.
  • A statement from AWS documentation specifying a 32 MB limit for Claude Platform on AWS, and how requests exceeding that limit are handled.
  • What is returned when a request exceeds 10 MB when using AWS API Gateway's HTTP API.
  • A statement directly specifying the upper limit for request size for Lambda function URLs, and what is returned when that limit is exceeded.
  • The size at which each of the two 413 exceptions of Lambda is returned. Section 7.2 gives the observation from Chapter 11.
  • The error message returned by Bedrock when a size limit is exceeded.
  • Whether Claude supports the s3Location parameter in Converse.
  • The meaning of "MB" as used in Anthropic's documentation.

11. Observations from This Configuration

This chapter details the results of testing conducted on November 4, 2026 (UTC), using a validation account in the us-east-1 region. Each is a single observation, not a promise in the documentation (Section 2.2).

11.1 Configuration

  • A single Lambda function. Python 3.13, arm64 architecture, with 1,024 MB of memory. The function returns only the size of the received event's JSON, the number of characters in the body, the number of bytes after base64 decoding, and the value of isBase64Encoded. It does not call a model.
  • HTTP API, REST API, and function URL. The HTTP API uses a payload format of 2.0. The REST API is regional and utilizes Lambda proxy integration, with binaryMediaTypes set to application/octet-stream. The function URL uses BUFFERED. All three use AWS_IAM for authorization.
  • The following were sent: 10 payloads with a text/plain body (ranging from 1,000,000 to 11,000,000 bytes), 4 payloads with an application/octet-stream body (ranging from 4,400,000 to 4,800,000 bytes), and 4 payloads with a JSON body (ranging from 5,990,000 to 6,300,000 bytes) to the Invoke API.

The function's invocation was verified by examining the function's logs and the body returned by the function.

11.2 Text Body

The following table lists the responses received when sending a text/plain body.

EndpointBody BytesStatusWhat Came BackFunction Invoked
HTTP API1,000,000 to 6,280,000200Function responseYes
HTTP API6,300,000 to 10,485,760413JSON whose message is Request Entity Too LargeNo
HTTP API10,490,000 and 11,000,000413Same message. The response lacks a content-type header.No
REST API1,000,000 to 6,280,000200Function responseYes
REST API6,300,000 to 10,485,760413JSON whose message is Request Too Long. The x-amzn-errortype is BadRequestException.No
REST API10,490,000 and 11,000,000413The body is the default message HTTP content length exceeded 10485760 bytes.No
Function URL1,000,000 to 6,280,000200Function responseYes
Function URL6,300,000413RequestEntityTooLargeException. Message is the first line below.No
Function URL9,900,000 to 11,000,000413RequestEntityTooLargeException. Message is the second line below.No

The messages returned by the Function URL are as follows:

6302758 byte payload is too large for the RequestResponse invocation type (limit 6291456 bytes)
Request must be smaller than 6291456 bytes for the InvokeFunction operation

With this configuration, the boundaries for the three paths were between 6,280,000 bytes and 6,300,000 bytes. The 6291456 bytes in the messages is 6 × 1,048,576, which matches the Lambda limits page's statement that MB means 1,024 KB. The 6302758 in the first line is 2,758 bytes larger than the 6,300,000-byte body. This article interprets this number as the size of the event received by the function (Inference).

Based on the size of the JSON event returned by the function, when the body was 1,000,000 bytes, the non-body portion was approximately 2,900 bytes for the HTTP API, approximately 4,700 bytes for the REST API, and approximately 2,800 bytes for the function URL. This size can vary depending on the request headers (Inference).

The REST API returned Request Too Long for a body size of 10,485,760 bytes and returned the default gateway response for a body size of 10,490,000 bytes. The function was not invoked in either case. This article interprets the former as a rejection due to Lambda's 6 MB limit and the latter as a rejection due to the gateway's 10 MB limit (Inference). With this configuration, the boundary where the REST API returned the default gateway response was between 10,485,760 bytes and 10,490,000 bytes. Similarly, with the HTTP API, between 10,485,760 bytes and 10,490,000 bytes, the presence or absence of the content-type header in the response changed. The response did not contain any information indicating which layer returned a 413 error (Observation).

11.3 Binary Body

The body of the application/octet-stream requests resulted in isBase64Encoded being set to true and the function receiving a base64 encoded string, regardless of the path used. There were no binaryMediaTypes configurations set for either the HTTP API or the function URL.

A 4,500,000-byte file was converted to 6,000,000 characters, and a 4,600,000-byte file was converted to 6,133,336 characters, successfully passing through all three paths. A 4,800,000-byte file (6,400,000 characters), however, was stopped with an error code 413 on all three paths. Based on this configuration, the size threshold for binary files to successfully pass through was between 4,600,000 bytes and 4,800,000 bytes. The 4,718,592 bytes of the inference in Section 6.2 is in this range.

11.4 Invoke API

The payloads of 5,990,000, 6,010,000, and 6,280,000 bytes sent to the Invoke API returned 200 with the function's response. However, a 6,300,000-byte payload resulted in an HTTP 413 error and a RequestEntityTooLargeException, with the following message:

6300000 byte payload is too large for the RequestResponse invocation type (limit 6291456 bytes)

The name of this exception does not correspond to either RequestTooLargeException or SerializedRequestEntityTooLargeException, as listed in the Invoke API reference under HTTP 413 (Section 7.2).

11.5 Reading the Observations Alongside the Sources

  • The 6 MB limit for Lambda, calculated as 6,291,456 bytes when considering 1,024 KB per MB, aligns with the observed message size limit.
  • The default message of the REST API gateway response was returned in this configuration too.
  • Section 6.2's inference (that the body is smaller than 6 MB and further reduced when base64 encoded) also aligns with the observations.
  • The name of the exception returned by the Invoke API differed from the names of two exceptions listed in the API reference. This article does not decide that either is wrong.

11.6 What This Configuration Does Not Show

  • What is returned when exceeding the limits of the Claude API, Claude Platform on AWS, and Bedrock. This configuration sent no request to a Claude-side entry point.
  • The behavior of the WebSocket API and Application Load Balancer (ALB). This configuration did not create either of them.
  • Limits on the response side.
  • Results obtained on different days, in different regions, and with different header sizes.

12. Failure Modes

This chapter lists common failures that occur when sending large requests to Claude, based on the content from Chapters 3 through 10. All of these are built from statements in the documentation and do not represent a compilation of actual reported cases.

  • Assuming 128 MB for Claude, setting upload limits behind API Gateway and Lambda: Only 6 MB is effective for synchronous Lambda invocations, and the body must be smaller than that (Sections 6.1 and 6.2).
  • Lambda functions behind an Application Load Balancer (ALB) receiving PDF files: Requests exceeding 1 MB will result in an HTTP 413 error (Section 5.4).
  • Sending images in a single message via a WebSocket API: Messages exceeding 128 KB will result in the connection closing with code 1009 (Section 5.2).
  • Believing that enabling response streaming will allow larger requests: API Gateway does not support request streaming (Section 8.1).
  • Assuming that you can send up to 128 MB to Claude via Bedrock: Anthropic’s documentation states a 20 MB limit for Bedrock (Section 4.2).
  • Interpreting 25000000 of InvokeModel as 25 MB and concluding that it contradicts the 20 MB limit mentioned elsewhere: The value 25000000 lacks a unit, and the two values limit different things (Section 10.1).
  • Designing with the assumption that you can use the Files API with Claude on Bedrock: the Bedrock page in Anthropic’s documentation lists the Files API among the features not supported (Section 9.2).
  • Believing that you can send images encoded in base64 within JSON, up to a size of 6 MB: Lambda’s 6 MB limit refers to the size of the event, and base64 encoding makes the body about 4/3 of the original size (Section 6.2).
  • Searching for 413 errors in the execution logs of API Gateway REST APIs: These errors may not always be present in the execution logs. The re:Post Knowledge Center recommends checking access logs (Section 7.3).
  • Determining Lambda 413 errors solely based on the names of two exceptions listed in the API reference: In Chapter 11, the Invoke API returned a different exception name, RequestEntityTooLargeException (Sections 7.2 and 11.4).

13. Frequently Asked Questions About Request Size Limits Between Your App and Claude

This chapter compiles information from the article in a question-and-answer format. The rationale behind each answer is provided in the sections enclosed in parentheses.

13.1 Claude's Limit Rose to 128 MB. Can I Send Up to 128 MB on AWS Too?

There are some paths where this isn't possible. 128 MB refers to the values provided by the first-party Claude API, specifically the Messages API and the Token Counting API. Anthropic's documentation states 20 MB for Bedrock and 32 MB for Claude Platform on AWS. Furthermore, there are additional limitations: 10 MB for API Gateway, 6 MB for synchronous Lambda invocations, and 1 MB for ALB Lambda targets, all of which precede Claude's entry point (Chapters 4 and 6).

13.2 How much data (in MB) can be sent when using API Gateway and Lambda?

Behind API Gateway and Lambda, the 6 MB payload limit of a synchronous Lambda invocation applies first. This 6 MB refers to the size of the JSON event received by Lambda, and the body itself must be smaller. When the body is encoded in base64, it will be even smaller (see Section 6.2). In the configuration in Chapter 11, text bodies passed up to 6,280,000 bytes and stopped at 6,300,000 bytes. Binary files could pass up to 4,600,000 bytes.

13.3 Is the Bedrock Limit 20 MB or 25 MB?

Anthropic's documentation states that Bedrock requests are limited to 20 MB. The AWS InvokeModel API reference specifies an upper limit of 25000000 for the length of body, but does not indicate the unit of measurement. This article found no page that states 25 MB. These two values represent limits for different aspects (see Section 10.1).

13.4 What Is the Limit for Claude Platform on AWS?

The Anthropic API overview page states that the Claude Platform on AWS accepts Messages and Token Counting requests of up to 32 MB. No request size value was found in the Claude Platform on AWS user guide in AWS documentation (Section 4.2).

13.5 Would it be possible to send large requests using streaming responses?

No. The API Gateway response transfer mode page states that it does not support streaming requests. Even the 200 MB limit for Lambda functions is a maximum for streaming responses (see Section 8.1).

13.6 What will be returned if the limit is exceeded?

What is returned when the limit is exceeded varies depending on the layer. The first-party Claude API returns a request_too_large error (413), and Cloudflare returns it before the API server. The API Gateway's REST API returns REQUEST_TOO_LARGE (413). ALB returns an HTTP 413 error. WebSocket APIs close the connection with code 1009. No statement was found on what Claude Platform on AWS, Bedrock, HTTP APIs, and function URLs return (Chapter 7). In the configuration in Chapter 11, HTTP APIs and function URLs also returned 413 (Observation).

13.7 What options are available for sending large PDF files to Claude on Bedrock?

The Bedrock page in Anthropic's documentation lists the Files API and URL sources for documents among the features not supported. Anthropic's documentation specifies a Bedrock request limit of 20 MB, while AWS documentation states that Bedrock's Converse feature supports documents up to 4.5 MB per document. The page count limit for PDFs also applies (see Sections 8.3 and 9.2).

13.8 Will using CloudFront result in lower limits?

No, it will not. The CloudFront limits page specifies a maximum size of 64 GB for HTTP request bodies. This exceeds the limits of any layer discussed in this article. The exception is field-level encryption: the same page lists 1 MB as the maximum length of a request body when it is configured (see Section 5.5).

14. Summary

The layer with the smallest limit on the path determines the maximum size of a single request from the application to Claude.

  • Claude Side: The first-party Claude API's Messages and Token Counting limits are 128 MB. Anthropic's documentation states 20 MB for Bedrock and 32 MB for Claude Platform on AWS. The 32 MB figure refers to the limits for Messages and Token Counting.
  • Origin of Bedrock's Value: The 20 MB figure originates from Anthropic's documentation. AWS documentation mentions a value of 25000000 (unit unspecified) for the body length in InvokeModel, as well as limits for images and documents within Converse.
  • Front Layers on AWS: API Gateway's REST API and HTTP API have a limit of 10 MB, WebSocket API has a limit of 128 KB, Lambda's synchronous invocations have a limit of 6 MB, and ALB's Lambda targets have a limit of 1 MB. CloudFront's 64 GB does not lower the effective limit, except when field-level encryption is configured (1 MB, Section 5.5).
  • Effective Limit Per Path: Paths that pass through an API Gateway REST or HTTP API and Lambda have a limit of 6 MB, with the body size being smaller than that. Paths that pass through ALB have a limit of 1 MB.
  • Response Streaming: Response streaming only increases the limit on the response side.
  • Behavior When Exceeded: What comes back when a limit is exceeded varies by layer. In five out of the ten layers described in Section 7.1, it was not possible to find documentation specifying what is returned when the limit is exceeded.
  • Chapter 11 Configuration: Lambda's 6 MB was 6,291,456 bytes. Text bodies passed up to 6,280,000 bytes on all three paths and stopped at 6,300,000 bytes.

Before building an application that sends large inputs to Claude, ensure the following:

  • You have identified all layers within your path and determined the client-side limit based on the smallest value among those layers.
  • You have verified the values for each layer by referencing the relevant documentation from each company.
  • You have accounted for Lambda's 6 MB limit, considering it as the size of the event rather than the body.
  • You have not assumed that response streaming changes the request limit.
  • You have checked, in the documentation, a configuration that keeps large files out of the front layers, and the mechanisms (the Files API, S3) that work on your path.

15. References

Anthropic Claude Platform Docs


Amazon Bedrock


Claude Platform on AWS


Amazon API Gateway


AWS Lambda


Elastic Load Balancing and Amazon CloudFront


AWS Step Functions


Other AWS Pages



References:
Tech Blog with curated related content

Written by Hidekazu Konishi