Generate images
Send JSON toPOST https://api.floodgate.dev/v1/images/generations.
n from 1 to 10. Models ending in -c accept one image per request.
For gemini-3.1-flash-image in the Standard group, use n: 1, response_format: "b64_json", and omit quality. Other image models have their own settings in Model Square.
Edit images
Send an image and prompt toPOST https://api.floodgate.dev/v1/images/edits.
-F "image[]=@input.png". Up to 16 input images are accepted, subject to the selected model’s limits.
You can also send JSON with an images array:
-F "mask=@mask.png;type=image/png": transparent regions select areas to change.-F "markup=@markup.png;type=image/png": GPT Image 2.6 accepts a transparent PNG annotation layer aligned with the first input image. Describe the change in your prompt.
GPT image settings
Higher quality can increase cost and generation time. Complexity controls planning separately from image quality.
Custom sizes
Custom sizes
Token-priced GPT Image 2 and later models accept custom
WIDTHxHEIGHT values such as 1536x864. Both dimensions must be multiples of 16, neither edge may exceed 3,840 pixels, the aspect ratio must be between 1:3 and 3:1, and total pixels must be between 655,360 and 8,294,400.Per-request -c models also accept 1K, 2K, or 4K, depending on the group. Check the model’s allowed settings in Model Square.Image models
Choose an available model and routing group in your API key settings, or use smart routing. Model Square shows current prices and supported operations.GPT image models
Earlier models remain available where listed in Model Square:
gpt-image-1, gpt-image-1-mini, gpt-image-1.5, gpt-image-2, gpt-image-2.5-flare, and gpt-image-2.5-sunburst. The gpt-image-2-c, gpt-image-2.5-flare-c, and gpt-image-2.5-sunburst-c variants use per-request pricing.
Other Images API models and routing groups
Other Images API models and routing groups
Native Gemini API
Put the model ID in the URL and includeIMAGE in responseModalities.
candidateCount: 1. Choose 1K or 2K for imageSize. Decode inlineData.data using its inlineData.mimeType.
Native Gemini models and routing groups
Native Gemini models and routing groups
Responses and pricing
Images API results containdata[].b64_json or data[].url. Decode the base64 data or download the returned URL promptly. Do not send your Floodgate API key to an image download host.
Token-priced GPT images charge actual text input, image input, and output usage. Cache discounts apply when reported; otherwise normal input rates apply. Batch usage already includes all outputs, so do not multiply the token counts by n again. Models ending in -c use the selected group’s per-request price.
See Billing for reserved funds and account discounts, and your usage logs for the charge breakdown. For request errors, see Troubleshooting.