Skip to main content
POST

Authorizations

x-key
string
header
required

Body

application/json

FLUX 3.1 Image: text-to-image, or editing with up to 10 images.

prompt
string
required

Free-form prompt describing the image.

user
string | null

Opaque identifier for the end user supplied by the calling platform.

Required string length: 1 - 256
Pattern: ^[^\x00]*$
images

Input image(s), up to 10 (9 with mask): URL or base64, 20 MB each at most.

mask
string | null

Mask for a local edit. Image 1 (the first of images) is the target image of the local edit: white may change, black is kept. URL or base64, at image 1's aspect ratio. With mask, images takes at most 9 images: the mask counts as image 10. A black-and-white mask can also be sent as one of images.

aspect_ratio
enum<string>
default:auto

Output aspect ratio. auto: chosen from the prompt. match_first_image: the first image's. Ignored when width and height are set.

Available options:
21:9,
2:1,
16:9,
3:2,
7:5,
4:3,
5:4,
1:1,
4:5,
3:4,
5:7,
2:3,
9:16,
1:2,
9:21,
match_first_image,
auto
resolution
enum<string>
default:auto

Output size. 1MP to 16MP: megapixels. 1k / 2k / 4k: the pixels of a 1024 / 2048 / 4096 square. hd / fhd / qhd / uhd: 1280x720 / 1920x1080 / 2560x1440 / 3840x2160, which also sets the aspect ratio. match_first_image: the first image's pixel count. auto: chosen from the prompt. Ignored when width and height are set.

Available options:
1MP,
2MP,
4MP,
8MP,
12MP,
16MP,
1k,
2k,
4k,
hd,
fhd,
qhd,
uhd,
match_first_image,
auto
width
integer | null

Output width in pixels; set together with height. width x height: 250000 to 16822272 pixels, aspect ratio within 8:1.

height
integer | null

Output height in pixels; set together with width.

safety_tolerance
integer
default:2

Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.

Required range: 0 <= x <= 7
grounding
enum<string>
default:off

Web lookups for reference images and facts. auto: the model decides per request. force: always look things up. off: never look anything up.

Available options:
auto,
force,
off
bounding_boxes
Flux31BoundingBox · object[] | null

Where objects go in the output, at most 32 boxes.

version
string
default:latest

Version of the endpoint's behavior.

Allowed value: "latest"
mode
enum<string>
default:quality

Speed and quality trade-off.

Available options:
fast,
quality
output_format
enum<string>
default:jpeg

Output image format.

Available options:
jpeg,
png
webhook_url
string<uri> | null

URL to receive webhook notifications

Required string length: 1 - 2083
webhook_secret
string | null

Optional secret for webhook signature verification

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)