Agent Provider Depot / Error Rescue Index (28 Traps) / context-length-exceeded-413
platform_limittrapId: trap-context-length-exceeded-413 · asOf: 2026-10-28
Context Window Exceeded / 413 Payload Too Large (context_length_exceeded)
Unbounded tool outputs, full HTML dumps, or multi-file diffs overflow 128K-200K token windows and trigger HTTP 400 context_length_exceeded or 413 Payload Too Large.
1. Immediate Code & SKU Fix
Replace With SKU:
gemini-2.5-pro (1M-2M context) + Jina Reader / Firecrawl markdown compressionInstall Command:
npm install @google/genaiRequired Env Vars:
GEMINI_API_KEY// Truncate tool stdout to <16KB or route >200K token payloads to gemini-2.5-pro via @google/genai
2. Verified Hot-Swap Fallback Route
JTBD: long-context-analysis
Primary: google-vertex → Fallback: anthropic
liveHealth: operational · autoActOk: true
Compliance blocks Anthropic
Matched Error String Signatures (5)
context_length_exceededmaximum context length413 Payload Too Largeprompt is too longstring_above_max_lengthcurl -s "https://getagentdepot.com/api/rescue?q=context_length_exceeded"
Browse All 28 Agent Runtime Rescue Cards
deprecated-claude-3-5-sonnetdeprecated-openai-gpt4deprecated-ada-002deprecated-google-generative-aiwrong-package-r2wrong-package-pinecone-clientwrong-package-mailgun-jsrate-limit-429provider-outage-529payment-required-402waf-bot-blocksmtp-port-25-timeoutlambda-15m-timeoutvercel-4-5mb-payloadsqlite-busyneon-cold-startsmithery-connect-shutdowngemini-preview-shutdown-2026-11-17openai-tts-1-shutdown-2027-01-06openai-insufficient-quotacontext-length-exceeded-413streaming-sse-econnresetcloudflare-1015-rate-limitvector-dimension-mismatchmcp-jsonrpc-method-not-foundsandbox-oom-exit-137postgres-too-many-connectionsheadless-browser-executable-missing