Generate an image
Content
Generate an image
Generates an image via the Brew AI image pipeline. text-to-image (default) creates from a prompt; image-editing edits image1 (required) guided by the prompt. Returns a CDN-hosted URL. Usage-metered: charges the actual image gateway cost (no fixed price).
POST
Generate an image
Authorizations
Send your Brew API key as Authorization: Bearer brew_xxx.
Headers
Optional idempotency key for safe retries. Reusing the same key with the same request body returns the original response for 24 hours.
Required string length:
1 - 100Body
application/json
Prompt + optional mode / aspect ratio / model / source images.
Required string length:
1 - 4000Available options:
text-to-image, image-editing Available options:
16:9, 3:2, 4:3, 1:1, 2:3, 3:4, 9:16 Available options:
google/gemini-3-pro-image, google/gemini-2.5-flash-image, google/gemini-3.1-flash-image-preview, bfl/flux-2-klein-4b, bfl/flux-2-pro, bfl/flux-2-klein-9b, qwen/qwen-image, qwen/qwen-image-edit