About this endpoint
What it does
Generates one or more images from a text prompt and returns them in a JSON response. The response includes a data array of image result objects, along with optional metadata such as model, job_id, status, created, and latency_seconds.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| prompt | String | Yes | Text prompt used to generate the images. |
| n | Integer | No | Number of images to generate. Default: 1. Minimum: 1. Maximum: 4. |
| lane | ENUM | No | Generation lane. Allowed values: fast, quality. Default: fast. |
| size | String | No | Output image size in WIDTHxHEIGHT format. Default: 1024x1024. Pattern: ^[0-9]{2,4}x[0-9]{2,4}$. |
| tier | ENUM | No | Tier. Allowed values: demo, registered, paid. Default: demo. |
| model | String | No | Model identifier. Default: black-forest-labs/FLUX.1-schnell. |
| private_by_default | Boolean | No | Whether generated assets are private by default. Default: true. |
Response
Returns a JSON object with a data array of result objects. Each result object can include index, width, height, asset_id, b64_json, mime_type, source_url, and revised_prompt; the top level may also include model, job_id, status, created, and latency_seconds.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object Array | No | Array of image result objects. Each item may include:<br>index (Integer)<br>width (Integer, nullable)<br>height (Integer, nullable)<br>asset_id (String, nullable)<br>b64_json (String, nullable)<br>mime_type (String, nullable)<br>source_url (String, nullable)<br>revised_prompt (String, nullable) |
| model | String | No | Model associated with the response. Nullable. |
| job_id | String | No | Job identifier. Nullable. |
| status | String | No | Status value. Nullable. |
| created | Integer | No | Creation timestamp. Nullable. |
| latency_seconds | Number | No | Request latency in seconds. Nullable. |