Skip to main content
POST
For step-by-step examples, see Use Gemini image models.
Use /v1beta/models/{model}:generateContent to generate or edit Nano Banana images. Put the model ID in the URL and send the prompt or source image parts in contents.

Choose a model

Use these stable IDs in requests. See Google’s Nano Banana guide for model options and the deprecation schedule for model lifecycle dates.
Gemini image responses can include intermediate image parts where thought is true. These are not the final output. When saving generated images, skip thought: true parts and use the last image part where inlineData exists and thought is not true. Choose the saved file extension from its mimeType: .jpg for image/jpeg, .png for image/png, or .webp for image/webp.

Authorizations

Authorization
string
header
required

Use your RunBridge AI API key.

Path Parameters

model
string
default:gemini-3.1-flash-image
required

Nano Banana image model ID. Use gemini-3.1-flash-image for the Flash examples, gemini-3-pro-image for Pro, or gemini-3.1-flash-lite-image for the Lite example.

Body

application/json
contents
object[]
required

Conversation turns. Each item has a role ("user" or "model") and parts array containing text and/or image data.

generationConfig
object

Controls generation behavior — output modalities, image resolution, thinking, etc.

tools
object[]

Optional Google Search grounding for gemini-3.1-flash-image and gemini-3-pro-image. Pass [{"google_search": {}}] to use real-time information in generated images. The Lite model does not support search grounding.

Response

200 - application/json

Success

candidates
object[]
usageMetadata
object
Last modified on October 9, 2026