LLM API
GoogleImage generationReleased February 26, 2026

Gemini 3.1 Flash Image (Preview)

Gemini 3.1 Flash Image (Preview) costs $0.5 per 1M input tokens and $60 per 1M output tokens on LLM API, with a 131K-token context window.

Pricing

Lowest price among 2 providers, after discounts.

Gemini 3.1 Flash Image (Preview) prices on LLM API
Input$0.5per 1M tokens
Output$60per 1M tokens

Providers

Prices after each provider’s discount; the lowest in bold.

Providers of Gemini 3.1 Flash Image (Preview) on LLM API
Google AI Studio$0.5$60
Google Vertex AI$0.5$60

Specifications

  • ModesGenerate, Edit
  • Output formatsPNG
  • Input imagesUp to 10, 20 MB each
  • Sizes14 sizes
    • 1024×1024
    • 512×2048
    • 384×3072
    • 848×1264
    • 1264×848
    • 896×1200
    • 2048×512
    • 1200×896
    • 928×1152
    • 1152×928
    • 3072×384
    • 768×1376
    • 1376×768
    • 1584×672

Call Gemini 3.1 Flash Image (Preview)

POST /v1/images/generationsSet LLMAPI_KEY to your LLM API key.Generate docs

import base64
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

result = client.images.generate(
    model="gemini-3.1-flash-image-preview",
    prompt="A lighthouse at dawn, watercolor",
)
with open(f"image.{result.output_format}", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))

More from Google

All Google image models

Prices synced .

You've been invited to LLM API

Top up $50 or more and the friend who invited you gets $20 in credits. We pay the $20; your credits stay yours. Referral terms

Sign up