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.
Vibekollen prepared this summary with AI from the original publication. The content belongs to OpenRouter.
More to read
Build an AI Code Reviewer with OpenRouter
OpenRouter 7 h ago
Lumaril, which develops AI software for optimizing industrial production by connecting to existing control systems, raised a $66M Series A at a $400M valuation
Techmeme 2 h ago
DeepSeek open sources Super-Agent as a research prototype, a proactive coding agent it says can monitor group chats for coding issues and suggest solutions
Techmeme 2 h ago
Insurance software maker Guidewire agrees to acquire Hyperexponential, which makes AI-powered insurance underwriting and pricing software, for $1.7B in cash
Techmeme 2 h ago
