- api
- platform
Oversized requests now fail fast with a clear 413
Every request body on the gateway has a hard ceiling of 10 MiB (10,485,760 bytes of JSON), set at our upstream provider's edge. Until today a request over that limit was uploaded in full and then bounced with an opaque "Upstream error (413)" — which is what you saw if you replayed a conversation carrying several large base64 images or a big attached document.
The gateway now measures a request before forwarding it and answers immediately with an HTTP 413 that names both the size it received and the limit. On the Anthropic wire (/v1/messages) the error type is request_too_large; on the OpenAI-compatible endpoints (/v1/responses, /v1/chat/completions) it is invalid_request_error with code request_too_large. A rejected request is never billed. To stay under the limit, downscale or compress images before encoding them, or trim replayed history — as a rule of thumb 10 MiB is about 7.5 MB of image bytes or 2.5 million characters of text, well below the token windows of the large-context models.