Skip to content

Google

Nano Banana 2

Generates and edits images quickly.

google/gemini-3.1-flash-image
Input → Output
Text, images → Text, images
Maximum input
131.1K tokens
Provider
1
Tool invocation
No

Price per million tokens

Input
810 credits
Text Printing
4,860 credits
Image Output
97,200 credits

About 108.9 credits to generate one 1K image (assuming 1,120 image output tokens). Actual output costs depend on the model and generation settings. Input is priced separately.

Provider

Several providers serve the same model. Performance is measured on actual AlpRouter requests over the last seven days, and uptime over the last three.

ProviderInput / 1MOutput / 1MCache readFirst tokenThroughputUptime
Google Vertex AI810 credits4,860 credits----

Time to first token and throughput are medians (P50). Values are hidden for fewer than 10 requests.

Use the API

import base64
from openai import OpenAI

client = OpenAI(
    base_url="https://alprouter.com/api/v1",
    api_key="alp-your-key",
)

answer = client.chat.completions.create(
    model="google/gemini-3.1-flash-image",
    messages=[{"role": "user", "content": "Please draw a paper airplane that flies over the sunset-hued sea."}],
)
# data:image/png;base64,... format. Depending on the model JPEGmay also be returned
url = answer.choices[0].message.images[0]["image_url"]["url"]
kind = url.split(";")[0].split("/")[1]
with open(f"image.{kind}", "wb") as file:
    file.write(base64.b64decode(url.split(",", 1)[1]))

Details

Maximum input
131.1K tokens
Maximum output
8.2K tokens
Tool invocation
Unsupported
Supported input
Text, images
Output
Text, images
Provider
Google Vertex AI
Supported parameters
image_config, max_completion_tokens, max_tokens, modalities, stream

Frequently asked questions

What kind of model is Nano Banana 2?

A model from Google. Generates and edits images quickly. Model ID on AlpRouter: google/gemini-3.1-flash-image

How much does Nano Banana 2 cost?

About 108.9 credits to generate one 1K image (assuming 1,120 image output tokens). One credit equals ₩1. Only usage is deducted from your balance. There is no monthly subscription.

How much input does Nano Banana 2 accept?

Each request accepts up to 131.1K tokens. The maximum output is 8.2K tokens.

What input and output does Nano Banana 2 support?

Send Text, images to receive Text, images.

Does Nano Banana 2 support tool calling and structured JSON?

Tool calling: Unsupported. Structured output (response_format): Unsupported.

Which providers handle Nano Banana 2 requests?

Google Vertex AI handles these requests.

How do I call Nano Banana 2 from code?

Just replace the base_url in the OpenAI SDK with https://alprouter.com/api/v1. Also, specify the name of the model in the model field (google/gemini-3.1-flash-image). There’s an example of how to do this in the “Using the API” section above.

Other models from Google