openrouter-gemini-image-generation

Installation
SKILL.md

OpenRouter Gemini Image Generation

Problem

OpenRouter's Gemini image models (Nano Banana, Nano Banana Pro) don't work with the standard /images/generations endpoint. Using this endpoint returns 404 errors, and even when the endpoint seems correct, aspect ratio validation and response parsing can fail.

Context / Trigger Conditions

  • Error: OpenRouter API error 404 Not Found when calling /api/v1/images/generations
  • Error: 400 Bad Request with message about invalid aspect_ratio values
  • Error: Failed to parse response: error decoding response body
  • Using models: google/gemini-3-pro-image-preview (Nano Banana Pro) or google/gemini-2.5-flash-image (Nano Banana)

Solution

1. Use Chat Completions Endpoint

Instead of /api/v1/images/generations, use /api/v1/chat/completions:

Installs
1
First Seen
Apr 1, 2026