-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Problem Description
I'm encountering a token limit error when using the google/gemini-3-pro-image-preview model through both the TypeScript client and the OpenRouter chat web interface.
Error Message
This endpoint's maximum context length is 128000 tokens. However, you requested about 550819 tokens (550222 of text input, 597 of tool input). Please reduce the length of either one, or use the "middle-out" transform to compress your prompt automatically.
Expected Behavior
The model should either:
- Accept the request and process it, or
- Provide clearer guidance on how to handle large context requests
Actual Behavior
The request is rejected with the above error message, even though I'm using the model through OpenRouter's interface.
Steps to Reproduce
- Use
google/gemini-3-pro-image-previewmodel via OpenRouter API (TypeScript client) - Or use the same model in OpenRouter's chat web interface
- Send a request with a large context (approximately 550K tokens)
- Receive the token limit error
Environment
- Model:
google/gemini-3-pro-image-preview - Platform: OpenRouter (both API and web interface)
- Client: TypeScript
Questions
- Is this a limitation of the underlying Google Gemini model, or is it specific to OpenRouter's implementation?
- What is the recommended approach for handling large context requests with this model?
- Is the "middle-out" transform feature mentioned in the error message available through OpenRouter?
- Are there any workarounds or best practices for working with large contexts using this model?
Additional Context
The error occurs consistently across both the API and web interface, suggesting it might be a model-level limitation rather than an implementation issue.
Thank you for your help!
Metadata
Metadata
Assignees
Labels
No labels