Things I want to do
Gemini 2.5 Flash Image (commonly known as nano-banana) has been released, so I’ll try using it with JavaScript. This model is said to be particularly good at image editing.
In the following article, I generated an image using Gemini 2.0, and then tried using the code I created with Gemini 2.5 Flash Image, but it failed. Here, I’ll document the corrections I made and the reasons why it didn’t work.
Notice
As of the time of writing this article (August 29, 2025), it is free (according to Google, projects not linked to a billing account).It could not be used.
However, since the Gemini 2.5 Flash Image (nano-banana) is a newly released model, there is a possibility that it will be fixed.
Things I tried
Create the JavaScript code referring to the following page.

(It won’t work as is, so it’s recommended to change the model name in the code on the following page to gemini-2.5-flash-image-preview.)
Result
It failed.
The browser logs showed the following output:
Failed to load resource: the server responded with a status of 429 ()
Understand this error
@google_genai.js?v=d283f444:7780 Uncaught (in promise) ClientError: got status: 429 . {'error':{'code':429,'message':'You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.','status':'RESOURCE_EXHAUSTED','details':[{'@type':'type.googleapis.com/google.rpc.QuotaFailure','violations':[{'quotaMetric':'generativelanguage.googleapis.com/generate_content_free_tier_requests','quotaId':'GenerateRequestsPerDayPerProjectPerModel-FreeTier','quotaDimensions':{'location':'global','model':'gemini-2.5-flash-preview-image'}},{'quotaMetric':'generativelanguage.googleapis.com/generate_content_free_tier_requests','quotaId':'GenerateRequestsPerMinutePerProjectPerModel-FreeTier','quotaDimensions':{'location':'global','model':'gemini-2.5-flash-preview-image'}},{'quotaMetric':'generativelanguage.googleapis.com/generate_content_free_tier_input_token_count','quotaId':'GenerateContentInputTokensPerModelPerMinute-FreeTier','quotaDimensions':{'location':'global','model':'gemini-2.5-flash-preview-image'}}]},{'@type':'type.googleapis.com/google.rpc.Help','links':[{'description':'Learn more about Gemini API quotas','url':'https://ai.google.dev/gemini-api/docs/rate-limits'}]},{'@type':'type.googleapis.com/google.rpc.RetryInfo','retryDelay':'2s'}]}}

Why did it fail?
The logs indicate that the limit has been exceeded. However, this error occurs from the very first time.
Upon carefully reading the linked page, it becomes clear that ‘Gemini 2.5 Flash Preview Image Generation’ is not available in the free version. (‘Gemini 2.0 Flash Preview Image Generation’ is available in the free version.)
In other words, the ‘Gemini 2.5 Flash preview image generation’ feature is unavailable in the free version.

However, this restriction may be corrected and made available in the future.


コメント