Generate an image
Authentication
Request
Background treatment. transparent requires an output_format that supports alpha (png or webp).
Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
Provider-specific passthrough configuration
Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
Optional. A convenience shorthand for output dimensions — pass a tier (“2K”, “4K”) or explicit pixels (“2048x2048”) and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.
If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.
Response
Unix timestamp (seconds) when the image was generated