Image model by Google

gemini-3.1-flash-image API

model: gemini-3.1-flash-image

Call gemini-3.1-flash-image with your KeelRouter API key, the same key you use for every other model. From $0.045 per image, paid per call from a prepaid balance. Failed calls are free.

Pricing

OptionPrice
512$0.046 per image
1K$0.045 per image
2K$0.06 per image
4K$0.10 per image

Call it

Async: POST /v1/images/generations returns a taskId; poll the same path with ?task_id= or pass a callback_url.

curl https://api.keelrouter.com/v1/images/generations \
  -H "Authorization: Bearer $KEELROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image",
  "prompt": "A lighthouse at dawn, watercolor",
  "resolution": "512"
}'

Parameters

NameTypeNotes
modelstringRequired. gemini-3.1-flash-image
promptstringRequired.
image_urlstring
image_urlsarray
aspect_ratiostringOne of auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3. Default auto.
resolutionstringOne of 512, 1k, 2k, 4k. Default 1k.
callback_urlstringOptional https URL; we POST the result when the task ends

FAQ

How much does the gemini-3.1-flash-image API cost on KeelRouter?
From $0.045 per image. You pay per call from a prepaid USD balance; failed calls are not charged.
How do I call gemini-3.1-flash-image?
POST to /v1/images/generations with model "gemini-3.1-flash-image". You get a taskId back; poll the same endpoint with ?task_id= or pass a callback_url.
Is this the official gemini-3.1-flash-image API?
No. KeelRouter is an independent API gateway. Requests run on gemini-3.1-flash-image through our upstream providers, and the image model keeps its own safety filters.
How long are results kept?
Result files are kept for 30 days, then deleted. Download what you want to keep.

More from Google

KeelRouter is an independent service and is not affiliated with Google. gemini-3.1-flash-image is a trademark of its owner, used here only to name the model a request runs on.