Gemini 3.1 Flash Image Preview Beta API on MaxAPI
Gemini 3.1 Flash Image Preview Beta is the MaxAPI fixed-price route family for the corresponding Google Gemini image model. It accepts the same OpenAI-compatible JSON shape as the non-beta route and also exposes Google's native v1beta/models/<id>:generateContent format for SDK parity.
Common use cases
- Generate new marketing, editorial, or product imagery from a text prompt
- Edit or recompose an existing image with one or more reference images
- Iterate quickly between aspect ratios and resolutions for the same prompt
- Mix multiple reference images to compose a new scene
Endpoints
Image generation is synchronous by default. Set "async": true to queue and poll, or pass X-MaxAPI-Async: true on the Gemini-native endpoint.
- POST /v1/images/generations
- POST /v1/images/edits
- GET /v1/images/generations/{task_id}
- GET /v1/images/edits/{task_id}
- POST /v1beta/models/google/gemini-3.1-flash-image-preview-beta:generateContent (Gemini-native)
- GET /v1beta/operations/{task_id} (async polling for the Gemini-native endpoint)
Lineage
Source: Google's Gemini image generation model family. MaxAPI exposes it through the OpenAI-compatible /v1/images/* endpoints and through Google's own /v1beta/models/<id>:generateContent format so existing Google AI SDK code works after pointing the base URL at https://api.maxapi.dev.
Dimensions and sizing
Supports a wider aspect_ratio set than 3 Pro (adds extreme ratios 1:4, 1:8, 4:1, 8:1) and an additional imageSize value 512 alongside 1K, 2K, and 4K. Output pixel dimensions follow Google's preset table — for example, 9:16 + 2K returns 1536×2752 pixels.
Available routes
Pass route_mode in the request body (or X-MaxAPI-Route-Mode on the Gemini-native endpoint) to select. If you don't pass one, MaxAPI follows the API key's configured order.
- official-cheap — lower-cost MaxAPI-configured route on the same upstream model, billed at a reduced rate.
- mix — blended route that may switch between providers for cost and stability; typically the lowest per-image price for beta variants.
Pricing
Pricing is per route mode. Failed requests are not charged. 1 credit = 1 USD.
- official-cheap: $0.07 per output image
- mix: $0.045 per output image
Quick example
curl -X POST "https://api.maxapi.dev/v1/images/generations" \
-H "Authorization: Bearer $MAXAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.1-flash-image-preview-beta",
"prompt": "a clean product photo of a glass cube",
"aspect_ratio": "1:1",
"resolution": "1K",
"n": 1
}'
FAQ
Is Gemini 3.1 Flash Image Preview Beta on MaxAPI OpenAI-compatible?
Yes. Send requests to POST /v1/images/generations and POST /v1/images/edits with an Authorization: Bearer header. The body shape matches OpenAI's image API.
How do I switch between route_mode options?
Pass "route_mode": "official" / "official-cheap" / "mix" in the JSON body, or set X-MaxAPI-Route-Mode on the Gemini-native endpoint. Defaults to the API key's configured order.
How is billing handled?
Failed requests don't charge credits. Per-image, per-call, and per-generation pricing is billed on completion; token-priced routes settle from upstream usage. 1 credit = 1 USD.
Where does the returned URL live?
Output assets are stored on MaxAPI's CDN (cdn.maxapi.dev) with a 7-day TTL. Pass "asset_delivery": "mirror" to receive URLs on the configured alias domain instead.
Full API reference