openrouter-gemini-image-generation
CommunityFix Gemini image gen errors with OpenRouter.
System Documentation
What problem does it solve?
OpenRouter Gemini image generation often returns 404 or 400 errors, especially with Nano Banana and Gemini image models, due to endpoint mismatches and invalid aspect_ratio handling. This Skill provides a robust workaround by switching the workflow to the chat completions endpoint with modalities to reliably generate images and properly parse responses.
Core Features & Use Cases
- Endpoint workaround: Use /chat/completions with modalities to generate images instead of /images/generations.
- Model compatibility: Supports Gemini image models (e.g., Nano Banana Pro and Nano Banana) and their edge cases.
- Input validation & parsing: Validates allowed aspect ratios and parses the nested response to extract image data for downstream use.
Quick Start
To generate an image, call the chat completions endpoint with modalities ["image","text"] and model "google/gemini-3-pro-image-preview" (or "google/gemini-2.5-flash-image"), ensuring aspect_ratio is a permitted value such as "16:9".
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: openrouter-gemini-image-generation Download link: https://github.com/strataga/claude-skill-inception/archive/main.zip#openrouter-gemini-image-generation Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.