ApexApiApexApi
Sign In
GoogleGoogleImage generation

Gemini 3.1 Flash Image (Preview) — direct API: Google AI's image-generation model, one key away

Gemini 3.1 Flash Image (Preview) — direct via the ApexApi gateway

The fast Gemini 3.1 image tier, roughly half the price of Gemini 3 Pro Image. Suited to volume generation where turnaround beats maximum fidelity. Call it through ApexApi's unified, OpenAI-compatible API with one `ak-` key, alongside every other model in the catalog. Pricing is $0.072–$0.192/image per image, billed pay-per-use from your credit balance with no subscription.

Gemini 3.1 Flash Image (Preview) — direct is served through ApexApi's unified, OpenAI-compatible API. One key, one format, with smart routing and automatic failover. Provider: Google AI.

Why Gemini 3.1 Flash Image (Preview) — direct

Text-to-image generation

High-quality image generation (and image-to-image where supported) through one API.

Transparent pricing ($0.072–$0.192/image)

Pay per image from your credit balance. Failed generations aren't billed.

OpenAI-compatible

Drop-in with any OpenAI SDK. Change the base URL and key, keep your code.

Specifications

Modality
image
Context window
131.1K tokens
Max output
65.5K tokens
Streaming
Yes
Tool / function calling
Vision input
Yes

Gemini 3.1 Flash Image (Preview) — direct pricing

  • It runs 1.9× cheaper than Gemini 3 Pro Image Preview, the pricier option from the same maker.

Getting started with Gemini 3.1 Flash Image (Preview) — direct

OpenAI-compatible. Point your client at ApexApi, swap your key, and call it. No new SDK to learn.

import requests

resp = requests.post(
    "https://api.apexapi.dev/v1/images/generations",
    headers={"Authorization": "Bearer <YOUR_APEXAPI_KEY>"},
    json={"model": "google/gemini-3.1-flash-image-preview", "prompt": "A serene mountain lake at golden hour"},
)
print(resp.json())

Gemini 3.1 Flash Image (Preview) — direct use cases

What teams build with Gemini 3.1 Flash Image (Preview) — direct on ApexApi.

Marketing & creative

On-brand visuals, ad creative, and product imagery at scale.

In-product generation

Generate images inside your app from user prompts.

Prototyping

Rapid concept art and design exploration.

Gemini 3.1 Flash Image (Preview) — direct vs other models

How it compares, and on ApexApi you can switch between any of them with a single string change, same key, same endpoint.

Gemini 3.1 Flash Image (Preview) — direct vs Nano Banana Pro

Compare Gemini 3.1 Flash Image (Preview) — direct against this model on price, capabilities, and latency. A/B them with a single key on ApexApi.

Learn more about Nano Banana Pro API →

Gemini 3.1 Flash Image (Preview) — direct vs FLUX.2 Pro

Compare Gemini 3.1 Flash Image (Preview) — direct against this model on price, capabilities, and latency. A/B them with a single key on ApexApi.

Learn more about FLUX.2 Pro API →

Gemini 3.1 Flash Image (Preview) — direct API: FAQ

How do I call Gemini 3.1 Flash Image (Preview) — direct through ApexApi?

Create an ApexApi key, point your client at https://api.apexapi.dev/v1, and POST to /v1/images/generations with the model set to `google/gemini-3.1-flash-image-preview`. The API is OpenAI-compatible, so an existing OpenAI SDK works once you change the base URL and key.

How much does Gemini 3.1 Flash Image (Preview) — direct cost on ApexApi?

$0.072–$0.192/image, billed per image with no subscription or minimum. The exact figure is shown before you generate, so nothing is charged against a price you have not seen.

What is the context window for Gemini 3.1 Flash Image (Preview) — direct?

131,072 tokens. It can return up to 65,536 tokens in a single response.

What should I use instead of Gemini 3.1 Flash Image (Preview) — direct?

From the same maker, Gemini 2.5 Flash Image costs less for lighter work and Gemini 3 Pro Image Preview is the step up when this one falls short. Switching is one string: both run on the same endpoint and the same key, so there is nothing to re-integrate.

Ready to build with Gemini 3.1 Flash Image (Preview) — direct?

One API key. Every major AI model. Pay only for what you use.

Get your API key, free to start
Gemini 3.1 Flash Image (Preview) — direct API on ApexApi