llm
input_error
ai_generated
true
InvalidRequestError: total tokens exceed model maximum
ID: llm/token-limit-exceeded
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Combined input+output tokens exceed model limit.
genericWorkarounds
-
92% success Count tokens before request with tiktoken/tokenizer
-
90% success Reserve token budget: max_tokens = model_limit - input_tokens - buffer
Dead Ends
Common approaches that don't work:
-
Set max_tokens to model limit ignoring input
78% fail
Input takes from same budget
-
Remove system prompt to save tokens
80% fail
Loses instruction context