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

i keep getting the same error response in the Firebase Studio Chat. with additional info like:

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-preview-06-05:streamGenerateContent?alt=sse: [500 Internal Server Error] An internal error has occurred. Please retry or report in Troubleshooting guide  |  Gemini API  |  Google AI for Developers

first i thought and it looked like a gemini server side problem, or probleby it is… But i notice i only have it one specific project in the FB Studio, in another projects it seems to work fine. been taking for like 6 hours now. Dont really know what to do.

i tried clearing cache, or some other things. anyone any idea?

Addition to above text:
it suddenly started working after i posted this, so in my case i just had to wait. But i decided to leave this here for now. In this case waiting paid off

1 Like

Hi @BaseAI_Works,

Glad to hear that your issue has been resolved!

Yes, a “500 Internal Server Error” is typically a transient error. In most cases, waiting a bit and then retrying the request is the right approach.

Thank you!

1 Like

Same problem:
[GoogleGenerativeAI Error]: Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-2.5-pro:streamGenerateContent?alt=sse: [500 Internal Server Error] An internal error has occurred. Please retry or report in Troubleshooting guide  |  Gemini API  |  Google AI for Developers

Hi @Eloa_Sisde,

Welcome to the Forum,

A 500 error typically indicates an unexpected issue on Google’s end. Please wait and try your request again.

Thank you!

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 (2993755) exceeds the maximum number of tokens allowed (1048576).

I have tried everything to start a new chat…People say to remove code, but since I have been building with this code, I am unsure of exactly what to do. NEED specific Help. It, I think is calling my entire thread all of a sudden, right when I got it to work well. I thought a balze plan would solve it but no. ANY direct assistance because I have been working exclusively with AI…so when people say remove JSON files, I have no idea if that will work, or HOW to do it without AI…

Hi @nocodetbxi,

We apologize for the delayed response. 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 2,993,755 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.

Thank you!

Im getting the same issue: [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 (2566879) exceeds the maximum number of tokens allowed (1048576). - it actually looks like the AI is pulling the entire thread for the development as one prompt?

Really dont know what to do here, I honestly dont want to start over