Seedream 5.0 Pro 正式上線 | 在圖片生成器中體驗 →
google
google/gemini-3.1-flash-image-preview

google/gemini-3.1-flash-image-preview

發布時間: 2026-02-26

65,536 context · $0.50/M input tokens · $3.00/M output tokens

Gemini 3.1 Flash Image Preview, 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 contextual understanding with fast, cost-efficient inference, making complex image generation and iterative edits significantly more accessible. Aspect ratios can be controlled with the image_config API Parameter

定價

按用量付費

無需預付費用,僅按實際使用量付費

輸入$0.50 / M Tokens
輸出$3.00 / M Tokens
Image Output$60.00 / M Tokens

試用模型

google/gemini-3.1-flash-image-preview
線上
google
嗨!我是樂於助人的 AI 助理。有什麼可以幫你的嗎?
準備在本機編碼 Agent 中使用這個模型嗎?Agent 設定

API 使用

使用以下程式碼範例整合我們的 API:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["WAVESPEED_API_KEY"],
    base_url="https://llm.wavespeed.ai/v1",
    timeout=120.0,
    max_retries=2,
)

try:
    response = client.chat.completions.create(
        model="google/gemini-3.1-flash-image-preview",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    print(response.choices[0].message.content or "")
except Exception as exc:
    raise SystemExit(f"LLM request failed: {exc}") from exc

模型介紹

Google gemini-3.1-flash-image-preview

Gemini 3.1 Flash Image Preview, a.k.a. "Nano Banana 2," is Google’s latest state of the art image generation and editing model, delivering Pro-level v

Gemini 3.1 Flash Image Preview, 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 contextual understanding with fast, cost-efficient inference, making complex image generation and iterative edits significantly more accessible. Aspect ratios can be controlled with the image_config API Parameter


Why It Looks Great

  • Large Language Model architecture for efficient processing
  • 65536 context window for long document handling
  • Competitive pricing at $0.5/$3.0 per million tokens

Key Features

  • Context Window: 65536 tokens
  • Max Output: 65536 tokens
  • Vision: Supported
  • Function Calling: Supported

Specifications

SpecificationValue
ProviderGoogle
Model TypeLarge Language Model (LLM)
ArchitectureN/A
Context Window65536 tokens
Max Output65536 tokens
InputText
OutputText
VisionSupported
Function CallingSupported

Pricing

Token TypeCost per Million Tokens
Input$0.5
Output$3.0

How to Use

  1. Write your prompt — describe the task, provide context, and specify desired output format.
  2. Submit — the model processes your request and returns the response.

API Integration

Base URL: https://llm.wavespeed.ai/v1 API Endpoint: chat/completions Model ID: google/gemini-3.1-flash-image-preview


API Usage

Python SDK

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://llm.wavespeed.ai/v1"
)

response = client.chat.completions.create(
    model="google/gemini-3.1-flash-image-preview",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.choices[0].message.content)

cURL

curl https://llm.wavespeed.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "google/gemini-3.1-flash-image-preview",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Notes

  • Model: google/gemini-3.1-flash-image-preview
  • Provider: Google

資訊

提供商google
類型llm

支援功能

輸入
文字影像
輸出
文字影像
上下文65,536
最大輸出65,536
視覺✓ 支援
函式呼叫-

API 存取指南

Base URLhttps://llm.wavespeed.ai/v1
API 端點chat/completions
Model IDgoogle/gemini-3.1-flash-image-preview

Gemini 3.1 Flash Image Preview API

google/gemini-3.1-flash-image-preview

Gemini 3.1 Flash Image Preview, 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 contextual understanding with fast, cost-efficient inference, making complex image generation and iterative edits significantly more accessible. Aspect ratios can be controlled with the image_config API Parameter

輸入

$0.5 /M

輸出

$3 /M

上下文

66K

最大輸出

66K

Vision

支援

在 WaveSpeedAI 試用 Gemini 3.1 Flash Image Preview

透過我們的統一 API 接入 Gemini 3.1 Flash Image Preview — 相容 OpenAI、無冷啟動、透明計費。

關於 Gemini 3.1 Flash Image Preview 的常見問題

Gemini 3.1 Flash Image Preview API 多少錢?+

WaveSpeedAI 定價:輸入每百萬 token $0.50,輸出每百萬 token $3.00。Prompt 快取與批次處理分別計費,可顯著降低長上下文、高重複任務的實際成本。

Gemini 3.1 Flash Image Preview 的上下文視窗有多大?+

Gemini 3.1 Flash Image Preview 每次請求最多支援 66K 上下文 token,輸出最多 66K token。

Gemini 3.1 Flash Image Preview 是否相容 OpenAI?+

WaveSpeedAI 透過 https://llm.wavespeed.ai/v1 的 OpenAI 相容 Chat Completions 介面提供 Gemini 3.1 Flash Image Preview。大多數 OpenAI SDK 用戶端只需更換 base URL 和 API Key;選用欄位取決於具體模型。

如何開始使用 Gemini 3.1 Flash Image Preview?+

登入 WaveSpeedAI,在 Access Keys 中建立 API Key,然後使用上方顯示的 model id 向 https://llm.wavespeed.ai/v1/chat/completions 發送請求。模型可用性、能力和價格請以目前模型目錄為準。

相關 LLM API

Nano Banana 2 | Google AI Image Generation API | WaveSpeedAI