This post was generated by an AI agent from an article the account owner published in Japanese on note. The wording is not human-written.
A small side project set out to let Claude Code (the VSCode extension) call Gemini's image generation directly from the editor, so that typing something like "make a banner image" in chat would trigger Gemini to generate it. The environment was Windows 11 Pro, VSCode with the Claude Code extension, Node.js v18.16.1, an active Gemini Plus (monthly) subscription, and an API key already issued from Google AI Studio.
Building the MCP server
Claude Code supports MCP (Model Context Protocol) servers, which work like plugins that let Claude Code call out to external tools. The plan was to implement one in TypeScript that would call Gemini's image generation API on request. The server was implemented and built successfully with no issues at that stage.
Every model attempt failed
Actually generating an image is where things broke down. Four different models were tried against the API:
-
gemini-2.0-flash-exp-image-generationreturnedquota exceeded, limit: 0 -
gemini-2.5-flash-imagereturned the samequota exceeded, limit: 0 -
imagen-4.0-generate-001returnedImagen 3 is only available on paid plans.— note the mismatch: the model requested was Imagen 4, but the error referenced Imagen 3 -
gemini-2.0-flash(the standard text model) returnedModel does not support the requested response modalities: text,image, since it was never an image-capable model in the first place
The limit: 0 errors were the confusing part: usage was zero, yet the request was reported as exceeding a quota. Checking the rate limit screen in Google AI Studio clarified it — only text-output models were listed there. Image generation models did not appear in that list at all. In other words, the free tier simply has no quota allocated for image generation; it isn't a matter of hitting a low limit, there is no limit to hit in the first place.
Gemini Plus and the Gemini API are unrelated
The root misunderstanding behind the whole attempt was treating the Gemini Plus subscription as if it applied to the API:
- Gemini Plus is the monthly plan used through the browser or app.
- Gemini API is the separate, developer-facing service called from code.
Gemini Plus does support image generation, but only inside its own browser/app interface. Calling the same capability from code requires API quota specifically, and as of March 2026 the free tier of the Gemini API carries no image-generation quota at all. Paying for the Gemini Plus monthly plan has no effect on what the API allows — the two billing relationships are entirely independent.
What came out of it
In the end, generating images through the free-tier API turned out to be impossible. What the project did accomplish:
- A working, buildable MCP server implementation
- A full picture of which models are actually available
- A precise understanding of what the free tier does and doesn't cover
What it did not accomplish was the original goal: actual image generation.
Three alternatives were identified for continuing the project:
- Enable billing in Google AI Studio (pay-as-you-go, with the option to set a budget cap)
- Build a dedicated Electron-based browser that automates the Gemini Plus web interface
- Use a locally-run model such as Stable Diffusion instead of the Gemini API
Option 2 — a dedicated automated browser — was the one the original article's author found most interesting, and the next attempt is planned around that approach.
Takeaways
- As of March 2026, the Gemini API's free tier has no quota for image generation at all
- Gemini Plus (the monthly subscription) and the Gemini API (the developer service) are completely separate products
- Using the image-generation API requires billing to be enabled; the Imagen model family specifically requires a paid plan
- The free tier only supports text generation, capped at 20 requests per day (RPD)
Anyone planning to try image generation through the Gemini API is better off checking the rate limit screen in Google AI Studio first. If only text-output models show up there, image generation isn't going to work on that account yet, no matter which model name is tried.
Follow @kmrb_works here on DEV for more field notes from real development work. Also on X and note, mostly in Japanese.
Top comments (0)