Skip to main content
POST
Flux 2 Flex Image Gen
FLUX.2 [flex] from Black Forest Labs delivers fast, flexible text-to-image generation with enhanced realism, sharper text rendering, and built-in editing for rapid iteration: a ready-to-use REST inference API, best performance, no cold starts, and affordable pricing.
This is an asynchronous API; only the task_id will be returned. You should use the task_id to request the Task Result API to retrieve the video generation results.

Request Headers

Content-Type
string
required
Supports: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

seed
integer
Random seed for generation. -1 means use a random seed. Range: -1 to 2147483647Value range: [-1, 2147483647]
size
string
Pixel size (width*height) of the output media. Each dimension ranges from 256 to 1536 pixels
images
string[]
A list of input image URLs for editing. Up to 3 images are supportedArray length: 1 - 3
prompt
string
required
A text prompt describing the expected editing effect for the image

Response

task_id
string
required
Use the task_id to request the Task Result API to retrieve the generated outputs.
Last modified on July 3, 2026