Gemini 2.5 Flash Image API on MaxAPI
Gemini 2.5 Flash Image is a Gemini image generation and editing model exposed through MaxAPI. It accepts the OpenAI-compatible /v1/images/generations endpoint and the Gemini-native v1beta/models/<id>:generateContent format.
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/gemini-2.5-flash-image:generateContent (Gemini-native)
- GET /v1beta/operations/{task_id} (async polling for the Gemini-native endpoint)
Lineage
Source family: Google Gemini image generation. MaxAPI exposes it through the OpenAI-compatible /v1/images/* endpoints and the Gemini-native /v1beta/models/<id>:generateContent format.
Dimensions and sizing
Output sizes are locked per aspect ratio (1:1 → 1024×1024, 9:16 → 768×1344, 16:9 → 1344×768). The model accepts aspect_ratio but ignores imageSize / resolution — Google does not expose a resolution selector on this model.
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 — provider's primary route, prioritized for source consistency and predictable behavior.
- official-cheap — lower-cost MaxAPI-configured route on the same upstream model, billed at a reduced rate.
Pricing
Pricing is per route mode. Failed requests are not charged. 1 credit = 1 USD.
- official: $0.04 per call
- official-cheap: $0.024 per call
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-2.5-flash-image",
"prompt": "a clean product photo of a glass cube",
"aspect_ratio": "1:1",
"resolution": "1K",
"n": 1
}'
FAQ
How do I call Gemini 2.5 Flash Image on MaxAPI?
Send requests to POST /v1/images/generations or POST /v1/images/edits with an Authorization: Bearer header. The body shape follows MaxAPI's OpenAI-compatible 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 media URL live?
Generated media is normally stored on MaxAPI's CDN for seven days. Pass "asset_delivery": "mirror" on supported generation endpoints to receive URLs on the configured alias domain instead.
Provider source: Google Gemini image generation documentation
Full API reference