-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Which version of the app are you using?
v3.10.2
Which API Provider are you using?
OpenRouter
Which Model are you using?
sonnet-3.7-thinking
What happened?
There's a severe discrepancy between the token count displayed in the UI and what's being sent to the API. The UI shows only 70.4k tokens out of a 200k limit, but the API is receiving a request with 257661 tokens - more than 3.5 times what's displayed in the UI.
The API returned this error:
"This endpoint's maximum context length is 200000 tokens. However, you requested about 257661 tokens (129661 of text input, 128000 in the output). Please reduce the length of either your prompt or max_tokens parameter or transform to compress your prompt automatically."
This makes it impossible to gauge whether a prompt will succeed or fail based on the UI's token counter.
Steps to reproduce
- Created a task with a large amount of text/code
- Observed the UI showing context window usage as 70.4k/200.0k tokens
- Submitted the request
- Received an error about exceeding context length (257661 tokens requested vs 200000 maximum)
Relevant API REQUEST output
Additional context
OpenRouter Transforms are OFF, but this should not matter with respect to internal token counting:
Screenshot:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status

