Gemini Flash Image API
Fast, high-fidelity images from Google's Gemini Flash image model, strong at photoreal scenes. One POST request returns a hosted image URL.
API Tester
Production endpoint{}
Pricing & Credits
Cost Per Image
$0.14 USD
14 credits per image. One image per request.
Billing Policy
Reserved: 14 credits are deducted before generation starts
Failed: Automatically refunded in full
Only credits_charged in a successful response is billed
API Reference
POST /api/gemini-flash-image
Fast, high-fidelity images from Google's Gemini Flash image model, strong at photoreal scenes.
Request Format
Send a POST request with a JSON body. The API key may also be sent as X-API-Key or Authorization: Bearer.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Required | Your API key for authentication. |
| prompt | string | Required | Text description of the image. Up to 4,000 characters. |
| size | string | Optional |
widthxheight. Default: 1024x1024. Only the listed sizes are accepted.
Unsupported sizes return 400.
|
| seed | integer | Optional | Fixes generation randomness for reproducible results where the model supports it. |
Response Examples
Success Response (200 OK)
{
"success": true,
"image_url": "https://netwrckstatic.netwrck.com/static/uploads/example.webp",
"images": ["https://netwrckstatic.netwrck.com/static/uploads/example.webp"],
"model_used": "or/gemini-3.1-flash-image",
"prompt_used": "Golden hour surf photo, telephoto compression",
"size_used": "1024x1024",
"cost": "0.14",
"credits_charged": 14
}
Error Responses
Every error has success: false, an error message and a retryable boolean. Only retry when retryable is true, and never more than twice with backoff.
| Status | retryable | Meaning |
|---|---|---|
| 400 | false | Invalid JSON, missing or oversized prompt, unsupported size, or the model rejected the prompt. |
| 401 | false | Missing or invalid API key. |
| 402 | false | Insufficient credits. |
| 429 | true | The model is busy. |
| 502 / 504 | true or false | Generation failed or timed out after 100 seconds. Credits are refunded. |
{
"success": false,
"error": "Unsupported size for Gemini Flash Image",
"retryable": false
}
Related
Browse every model on the API overview, or try the Gemini Flash Image tool in your browser.
Netwrck