Skip to content
VibekollenBETAVibekollen
BlogOpenRouter

Nano Banana API: Edit Images with Gemini in Code

Article image or reusable cover for OpenRouter

OpenRouter has enabled image editing with text instructions through its API.

You send a source image and a text description of desired changes in a single request and receive the edited image back. The guide demonstrates how to do this in Python and TypeScript, and explains that you can easily switch to a different editing model by changing a field in the code. You can also make multiple edits in sequence by sending each result back as a new source image.

You send the source image and an edit prompt to google/gemini-3.1-flash-image through the OpenRouter API, and the edited image comes back in the response.
Verbatim from the article at OpenRouter
Read the full story at OpenRouter →

Vibekollen prepared this summary with AI from the original publication. The content belongs to OpenRouter.

More to read