# Google: Nano Banana 2 (Gemini 3.1 Flash Image)

Canonical page: https://agentsky.dev/models/google/gemini-3.1-flash-image
JSON record: https://gateway.agentsky.dev/v1/models/google/gemini-3.1-flash-image

Google: Nano Banana 2 (Gemini 3.1 Flash Image) is a image and text-input model by Google, available through the AgentSky API as google/gemini-3.1-flash-image at $1.055 per million input tokens and $6.33 per million output tokens, with a 131K context window.

Gemini 3.1 Flash Image, a.k.a. "Nano Banana 2," is Google’s latest state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. It combines advanced...

## Facts

- **Model id:** `google/gemini-3.1-flash-image`
- **Maker:** Google
- **Input modalities:** Image, Text
- **Context:** 131K
- **Max output tokens:** 32,768
- **Aliases:** `google/gemini-3.1-flash-image`, `gemini-3.1-flash-image`

## Pricing

USD per million tokens on the default plan. Signed-in pages show your own plan's price; every response carries the cost of that call in `usage.cost`.

| Meter | Per 1M tokens |
|---|---|
| Input | $1.055 |
| Output | $6.33 |
| Cache read | $1.055 |
| Cache write | $1.055 |

## Use it

Anthropic wire base URL: `https://gateway.agentsky.dev`. OpenAI wire base URL: `https://gateway.agentsky.dev/v1`. Authenticate with an AgentSky API key (`ast_…`) and pass the model id.

### Anthropic SDK

```js
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://gateway.agentsky.dev",
  apiKey: process.env.AGENTSKY_API_KEY, // ast_…
});

const message = await client.messages.create({
  model: "google/gemini-3.1-flash-image",
  max_tokens: 256,
  messages: [{ role: "user", content: "Summarise this ticket." }],
});
console.log(message.usage.cost); // USD, in the response
```

### Claude Code

```bash
export ANTHROPIC_BASE_URL="https://gateway.agentsky.dev"
export ANTHROPIC_AUTH_TOKEN="$AGENTSKY_API_KEY"
export ANTHROPIC_MODEL="google/gemini-3.1-flash-image"

claude
```

### OpenAI SDK

```js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://gateway.agentsky.dev/v1",
  apiKey: process.env.AGENTSKY_API_KEY, // ast_…
});

const completion = await client.chat.completions.create({
  model: "google/gemini-3.1-flash-image",
  messages: [{ role: "user", content: "Summarise this ticket." }],
});
console.log(completion.usage.cost); // USD, in the response
```

### Codex

```bash
export OPENAI_BASE_URL="https://gateway.agentsky.dev/v1"
export OPENAI_API_KEY="$AGENTSKY_API_KEY"

codex --model google/gemini-3.1-flash-image
```

### OpenCode

```js
// opencode.json — then switch models any time with /models
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "agentsky": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "AgentSky",
      "options": {
        "baseURL": "https://gateway.agentsky.dev/v1",
        "apiKey": "{env:AGENTSKY_API_KEY}"
      },
      "models": { "google/gemini-3.1-flash-image": {} }
    }
  }
}
```

## Questions

### What is Google: Nano Banana 2 (Gemini 3.1 Flash Image)?

Google: Nano Banana 2 (Gemini 3.1 Flash Image) is a model from Google. Gemini 3.1 Flash Image, a.k.a. "Nano Banana 2," is Google’s latest state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. It combines advanced...

### How much does Google: Nano Banana 2 (Gemini 3.1 Flash Image) cost?

$1.055 / $6.33 per million tokens at the prices shown, for input and output respectively. The exact price of every call comes back in the response as usage.cost, so you never have to compute it.

### What is the context length of Google: Nano Banana 2 (Gemini 3.1 Flash Image)?

131K tokens, and it writes up to 33K tokens in one reply. These are the limits listed for this model in the current AgentSky catalog.

### Which clients can call Google: Nano Banana 2 (Gemini 3.1 Flash Image)?

Anything that speaks the Anthropic Messages API, which covers the Anthropic SDK and Claude Code or the OpenAI-compatible request format. Point the client's base URL at the gateway, use an AgentSky key, and pass google/gemini-3.1-flash-image as the model.

### How do I name Google: Nano Banana 2 (Gemini 3.1 Flash Image) in a request?

The gateway accepts google/gemini-3.1-flash-image, gemini-3.1-flash-image. Any of them resolves to the same model, so an existing integration usually needs no change to its model string.

### Can Google: Nano Banana 2 (Gemini 3.1 Flash Image) read images?

Yes. Its listed input types are image, text. Include the image with your request; image input does not imply image generation.

### What output can Google: Nano Banana 2 (Gemini 3.1 Flash Image) produce?

The listed output types are image, text. Choose the output type supported by the operation you call.

### How should I plan a long prompt for Google: Nano Banana 2 (Gemini 3.1 Flash Image)?

Plan your instructions, conversation history and source material around the 131K-token context limit, leaving room for the response. The listed response ceiling is 33K tokens. A larger window lets you supply more relevant material; it does not make unrelated content useful.

### What would 10,000 input tokens and 2,000 output tokens cost with Google: Nano Banana 2 (Gemini 3.1 Flash Image)?

At the displayed input and output rates, the model-token subtotal is $0.02321. This example assumes uncached input and excludes additional pricing categories, tool calls and agent runtime. Actual usage determines the final charge.

### How is cached input priced for Google: Nano Banana 2 (Gemini 3.1 Flash Image)?

The catalog lists $1.055 per million cache-read tokens. Cache writes are listed at $1.055 per million tokens. Repeating a prompt does not by itself guarantee a cache hit; only usage reported as cached receives that rate.

### Does the Google: Nano Banana 2 (Gemini 3.1 Flash Image) token price cover an entire agent task?

No. The model price covers the model usage described above. A task can also incur tool and runtime charges, and several model calls may be needed to complete it. Compare total task usage when evaluating cost.

### How do I use Google: Nano Banana 2 (Gemini 3.1 Flash Image) on AgentSky?

This model is listed for API use. Use the model ID google/gemini-3.1-flash-image with a supported gateway operation. The agent composer is not offered here because the current agent model menu has no compatible match.
