Sorry, I hit a snag

Sorry, I hit a snag. Please try again shortly or modify your prompt.

Sorry, I hit a snag. Please try again shortly or modify your prompt.
[GoogleGenerativeAI Error]: Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-2.5-pro:streamGenerateContent?alt=sse: [400 Bad Request] The input token count (1732985) exceeds the maximum number of tokens allowed (1048576).

How to get resolved with this???

Hi @zaadakart,

Welcome to the Forum,

You are encountering an error because the input you’re providing to the Gemini 2.5 Pro model has too many tokens. The current input has 1,732,985 tokens but the model’s limit is 1,048,576 tokens.

To fix this, you will need to make your input shorter by removing unnecessary context or summarizing the large blocks of text or breaking it down into 2-3 smaller requests instead of one large one.

Thank you!