Skip to main content
POST /api/v1/generate Content-Type: application/json for text-to-image · multipart/form-data for image editing
Parameter support can differ depending on the model used to generate the response. Check the Model Library for model-specific compatibility. Open Model Library.

Authentication

Send your API key in the Authorization header as a Bearer token.

Parameters

Common

Conditional

The following parameters are not supported by every model. Check the Model Library for model-specific compatibility.

Image Generation (Text Prompt)

Generate an image from a text prompt.

Image Editing (Upload or URL)

Transform the source image using an instruction prompt.

Examples

Image generation (JSON)

Generate an image from a text prompt using a JSON request body.

Image editing (multipart upload)

Upload an image file and apply an edit instruction prompt.