Skip to main content
POST

Overview

POST /flux/v1/\{model\} submits a native BFL-format image task. Store the top-level response id, then poll GET /flux/v1/get_result with that task ID. The API playground includes text-to-image request examples for FLUX.2 Pro, Flex, and Max. Check the Models page or /v1/models for model IDs and account availability.

Request fields

Start with prompt, width, height, and output_format. You can also send seed; the completed result can report the seed used, but that field alone does not establish repeatable output. For reference-image editing, send a public HTTPS image URL in input_image. This field is supported for the three FLUX.2 models above. FLUX.2 Pro also accepts a second public HTTPS URL in input_image_2; include input_image whenever you send input_image_2.

Submit and poll

The create response can use status: "processing" while the task runs. Use its top-level id with the CometAPI result endpoint; clients should not depend on a response-supplied polling_url. Poll until the result endpoint returns status: "Ready". Treat Error, Failed, Failure, Task not found, Request Moderated, and Content Moderated as failures. For other states, continue polling within your application’s retry and timeout limits.
When a task is ready, result.sample is a temporary image URL. Download or transfer it promptly; do not rely on a fixed lifetime.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Path Parameters

model
string
required

FLUX.2 model ID in the URL path. Check /v1/models or the Models page for account availability.

Body

application/json
prompt
string
required

Text prompt describing the image or reference-image edit.

Example:

"A clean editorial photograph of a red ceramic teapot on a pale blue table, soft window light, no text."

input_image
string

Public HTTPS URL of the first reference image. Replace the example URL with an image that the model provider can retrieve. This editing field is available for the FLUX.2 models covered by this reference.

Example:

"https://your-image-host/reference-one.jpg"

input_image_2
string

Public HTTPS URL of a second reference image for flux-2-pro. Replace the example URL and also send input_image.

Example:

"https://your-image-host/reference-two.jpg"

seed
integer

Optional seed value. A completed result can report the used seed; that field alone does not establish repeatable output.

width
integer

Requested output width in pixels. Use a dimension supported by the selected model.

Example:

1280

height
integer

Requested output height in pixels. Use a dimension supported by the selected model.

Example:

768

output_format
string

Requested output image format supported by the selected model. The examples use png.

Example:

"png"

Response

200 - application/json

FLUX task submission response. Save the top-level id and poll the CometAPI result endpoint.

id
string
required

Task ID to pass to GET /flux/v1/get_result?id=....

status
string
required

Submission state. An accepted task can return processing.

result
object | null

Task result. It can be empty or null at submission time.

polling_url
string | null

Response-supplied convenience URL when returned. Clients should poll the documented CometAPI result route by the top-level id.

cost
number | null

Numeric billing coefficient when returned. This field is not documented as a currency or credit amount.

input_mp
number | null

Input image megapixels when returned.

output_mp
number | null

Output image megapixels when returned.

progress
number | null

Task progress when returned.

details
any

Additional task details when returned.

preview
any

Task preview data when returned.

Last modified on July 31, 2026