Hello,
I’m currently developing an AI roleplaying game-style app on Google AI Studio that requires the player to roleplay with the AI, which generates a scenario and live images. I’m doing this for a PhD research project and therefore need to have my students test it in class (9 students) at the same time to comply with the research protocol. The problem is that it seems the Google API / Google AI Studio can’t handle requests from 9 users at the same time. At best, the images that should be generated don’t appear, the narration displays an error message, and the processing time is terribly long. At worst, it’s impossible to process any requests because the game instantly crashes with the 500 critical error message (see photo). How can I fix this problem so that my app can handle 9 people at a time without crashing the AI with the number of requests?
Would it be possible to create copies of the app using other API keys to limit this problem?
Thank you in advance for your help.
@Anna_Laura ,
could you tell us which model are you using ,?
is this issue persistent over multiple days?
also to answer your question , NO the total usage is computed per project basis not per key, even if you have multiple keys they all come under the same rate limit.
Thank you for your response. Yes, this issue is persistent : I tried again yesterday with 7 people connected at the same on my app at the same time, and the app was lagging and unable to display every image/narration even if it didn’t crash this time. I’m trying to understand why by looking at the metrics on Google Cloud Run, but everything seems normal and it looks like i’m not able to increase the max number of simultaneous requests or the rate limit - maybe because I’m on paid tier 1 with educationnal credits offered by the Google Education Teams for my PhD project. The model my app uses through Google AI Studio for text-based generation and analysis (like creating the story, understanding your actions, and providing language feedback) is gemini-2.5-flash. For generating the scene images, it uses imagen-4.0-generate-001.
@Anna_Laura ,
you can check your Tier-1 limits here
please check if the usage with all 7 users together is under the rate limits
also for image generation , you can only do 70 per day in total please check if that has been the case.
Thank you. I checked the rate limits here and it seems that I’m still under the rate limits for both the text generation and the image generation, so I don’t understand from where this API errors come from. Do you have any recommandation about what could I do to avoid the game app to lag and encouters errors whenever more than 3 persons play it at the same time ?
Hello,
Welcome to the forum!!
that Error 500 usually shows up because the input context is too long. Try shortening the context and it will be work. Here is the official guide with more info: https://ai.google.dev/gemini-api/docs/troubleshooting
Thanks