Gemini 2.5 Flash Image API on MaxAPI
Gemini 2.5 Flash Image is Google's Gemini image model exposed through MaxAPI. It accepts either the OpenAI-compatible /v1/images/generations endpoint or Google's native v1beta/models/<id>:generateContent. Output dimensions follow Google's preset table — for example, 9:16 at 2K returns 1536×2752 pixels.
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-2.5-flash-image: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
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
Is Gemini 2.5 Flash Image 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