curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, cliffs on one side, turquoise sea on the other, a single vintage car with headlights on, soft golden rim light",
"aspect_ratio": "21:9"
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "change the color of only one bird in the middle to #e01075",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/4792198dfeba9223bf3ecf020fed2942de7f0bd7-1800x1200.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Turn Image 1 in the Style of Image 2",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/ababcf5c9cf86074d71c92d6362ff63545d90661-1800x1201.webp",
"https://cdn.sanity.io/images/2gpum2i6/production/dc642f5b01040c4afc46c1b4f8c4945152932683-1350x1800.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Minimalist graphic illustration featuring a black silhouette of a person <silhouette_1> centered against a solid, vibrant chartreuse background <background_1>. The figure is captured in a dynamic, mid-stride running pose, facing toward the left side of the frame. The image relies entirely on the high-contrast relationship between the two colors, mimicking a digital recreation of a screen-printed or risograph aesthetic, with no discernible light source or shadow. [{\"id\":\"background_1\",\"bbox\":[0,0,1000,1000],\"desc\":\"A flat field of neon yellow-green possessing a subtle, tactile paper texture with fine, organic grain and slight variations in color saturation, giving the flat surface a sense of physical depth.\"},{\"id\":\"silhouette_1\",\"bbox\":[150,150,850,850],\"desc\":\"A black silhouette of a person in motion, composed of a dense, stippled texture that resembles physical ink on paper or a low-resolution digital dither. The leading edges, including the front of the head, chest, and forward leg, are relatively solid and opaque. The trailing edges, such as the back, outstretched rear arm, and lifted back leg, dissolve into a spray of coarse, square-shaped pixels and scattered dots. The black ink shows a slight textural irregularity, as if pressed onto a porous surface.\"}]",
"aspect_ratio": "1:1"
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "In <ref_image_0>, change the large tiger <animal_1> and the small glowing butterfly <insect_1> to be pink. Keep the massive fallen log <log_1>, the falling snow <snow_1>, and the dark background trees <trees_1> exactly unchanged. [{\"id\":\"animal_1\",\"from\":null,\"src_bbox\":null,\"tgt_bbox\":[250,50,850,650],\"desc\":\"Make both pink.\"},{\"id\":\"insect_1\",\"from\":null,\"src_bbox\":null,\"tgt_bbox\":[650,680,750,750],\"desc\":\"Make both pink.\"},{\"id\":\"log_1\",\"from\":\"ref_image_0\",\"src_bbox\":[600,0,1000,1000],\"tgt_bbox\":[600,0,1000,1000],\"desc\":\"A massive, fallen tree log stretching horizontally across the foreground. The surface features deep, rough-textured bark, weathered cracks, and small pockets of frost.\"},{\"id\":\"snow_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,1000,1000],\"tgt_bbox\":[0,0,1000,1000],\"desc\":\"Numerous white snowflakes of varying sizes falling across the scene. Some flakes are sharp and distinct, while others closer to the lens appear as blurred white streaks.\"},{\"id\":\"trees_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,650,1000],\"tgt_bbox\":[0,0,650,1000],\"desc\":\"A dense stand of tall, dark, vertical tree trunks receding into the distance. A cool, blue misty light permeates the spaces between the trees, glowing most intensely from the right edge.\"}]",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/b6476b163e11444d6d5490ac1fa1e610d4eab85e-1360x768.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "In <ref_image_0>, move the miniature grey amigurumi knight figure <knight_1> upwards and to the left along the yarn cliff <cliff_1>. Leave the polished steel tapestry needle <needle_1> in its original position in the air. Keep the rest of the image completely unchanged, preserving the blurred yarn backdrop <backdrop_1>, the large knitted dragon <dragon_1>, and the fiery orange thread <fire_1> suspended between them. [{\"id\":\"knight_1\",\"from\":\"ref_image_0\",\"src_bbox\":[500,150,850,350],\"tgt_bbox\":[194,55,544,255],\"desc\":\"A miniature amigurumi knight figure crocheted from thick grey woolen yarn. It has visible, intricate stitches forming a rounded helmet shape and a cylindrical body, with tiny stubby arms reaching upwards against the cliff.\"},{\"id\":\"backdrop_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,1000,1000],\"tgt_bbox\":[0,0,1000,1000],\"desc\":\"A soft, out-of-focus expanse of cream ivory and melange indigo knitted yarn, providing a blurred studio backdrop with tangible fiber fuzz catching the ambient light.\"},{\"id\":\"cliff_1\",\"from\":\"ref_image_0\",\"src_bbox\":[300,0,1000,450],\"tgt_bbox\":[300,0,1000,450],\"desc\":\"A steep, uneven cliff face constructed from stacked, thick yarn skeins in rich shades of mustard yellow, terracotta, and melange indigo, featuring visible woven wool textures and loose, stray fiber strands.\"},{\"id\":\"needle_1\",\"from\":\"ref_image_0\",\"src_bbox\":[420,250,550,450],\"tgt_bbox\":[420,250,550,450],\"desc\":\"A real, oversized polished steel tapestry needle, gleaming under the studio lighting. It features a blunt tip and an elongated eye, grasped like a weapon in the knight'"'"'s yarn-stub hand.\"},{\"id\":\"dragon_1\",\"from\":\"ref_image_0\",\"src_bbox\":[100,600,950,1000],\"tgt_bbox\":[100,600,950,1000],\"desc\":\"A large, fluffy knitted dragon made of highly textured, fuzzy yarn in terracotta and mustard yellow. It has a rounded snout, large crocheted eyes, and a wide-open mouth, with visible loose fibers creating a soft, tactile surface.\"},{\"id\":\"fire_1\",\"from\":\"ref_image_0\",\"src_bbox\":[350,400,650,650],\"tgt_bbox\":[350,400,650,650],\"desc\":\"Curled, sculptural puffs of fiery orange angora thread, suspended in mid-air. The thread is highly textured, fuzzy, and chaotic, bursting from the dragon'"'"'s mouth and stretching horizontally across the center.\"}]",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/aa7b28af831835fcef86e770262c8c30fa308c2c-1360x768.webp"
]
}'
{
"id": "<string>",
"polling_url": "<string>",
"cost": 123,
"input_mp": 123,
"output_mp": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Generate an image with FLUX 3
Generate or edit images with FLUX 3 and retrieve the asynchronous result.
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, cliffs on one side, turquoise sea on the other, a single vintage car with headlights on, soft golden rim light",
"aspect_ratio": "21:9"
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "change the color of only one bird in the middle to #e01075",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/4792198dfeba9223bf3ecf020fed2942de7f0bd7-1800x1200.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Turn Image 1 in the Style of Image 2",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/ababcf5c9cf86074d71c92d6362ff63545d90661-1800x1201.webp",
"https://cdn.sanity.io/images/2gpum2i6/production/dc642f5b01040c4afc46c1b4f8c4945152932683-1350x1800.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Minimalist graphic illustration featuring a black silhouette of a person <silhouette_1> centered against a solid, vibrant chartreuse background <background_1>. The figure is captured in a dynamic, mid-stride running pose, facing toward the left side of the frame. The image relies entirely on the high-contrast relationship between the two colors, mimicking a digital recreation of a screen-printed or risograph aesthetic, with no discernible light source or shadow. [{\"id\":\"background_1\",\"bbox\":[0,0,1000,1000],\"desc\":\"A flat field of neon yellow-green possessing a subtle, tactile paper texture with fine, organic grain and slight variations in color saturation, giving the flat surface a sense of physical depth.\"},{\"id\":\"silhouette_1\",\"bbox\":[150,150,850,850],\"desc\":\"A black silhouette of a person in motion, composed of a dense, stippled texture that resembles physical ink on paper or a low-resolution digital dither. The leading edges, including the front of the head, chest, and forward leg, are relatively solid and opaque. The trailing edges, such as the back, outstretched rear arm, and lifted back leg, dissolve into a spray of coarse, square-shaped pixels and scattered dots. The black ink shows a slight textural irregularity, as if pressed onto a porous surface.\"}]",
"aspect_ratio": "1:1"
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "In <ref_image_0>, change the large tiger <animal_1> and the small glowing butterfly <insect_1> to be pink. Keep the massive fallen log <log_1>, the falling snow <snow_1>, and the dark background trees <trees_1> exactly unchanged. [{\"id\":\"animal_1\",\"from\":null,\"src_bbox\":null,\"tgt_bbox\":[250,50,850,650],\"desc\":\"Make both pink.\"},{\"id\":\"insect_1\",\"from\":null,\"src_bbox\":null,\"tgt_bbox\":[650,680,750,750],\"desc\":\"Make both pink.\"},{\"id\":\"log_1\",\"from\":\"ref_image_0\",\"src_bbox\":[600,0,1000,1000],\"tgt_bbox\":[600,0,1000,1000],\"desc\":\"A massive, fallen tree log stretching horizontally across the foreground. The surface features deep, rough-textured bark, weathered cracks, and small pockets of frost.\"},{\"id\":\"snow_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,1000,1000],\"tgt_bbox\":[0,0,1000,1000],\"desc\":\"Numerous white snowflakes of varying sizes falling across the scene. Some flakes are sharp and distinct, while others closer to the lens appear as blurred white streaks.\"},{\"id\":\"trees_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,650,1000],\"tgt_bbox\":[0,0,650,1000],\"desc\":\"A dense stand of tall, dark, vertical tree trunks receding into the distance. A cool, blue misty light permeates the spaces between the trees, glowing most intensely from the right edge.\"}]",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/b6476b163e11444d6d5490ac1fa1e610d4eab85e-1360x768.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "In <ref_image_0>, move the miniature grey amigurumi knight figure <knight_1> upwards and to the left along the yarn cliff <cliff_1>. Leave the polished steel tapestry needle <needle_1> in its original position in the air. Keep the rest of the image completely unchanged, preserving the blurred yarn backdrop <backdrop_1>, the large knitted dragon <dragon_1>, and the fiery orange thread <fire_1> suspended between them. [{\"id\":\"knight_1\",\"from\":\"ref_image_0\",\"src_bbox\":[500,150,850,350],\"tgt_bbox\":[194,55,544,255],\"desc\":\"A miniature amigurumi knight figure crocheted from thick grey woolen yarn. It has visible, intricate stitches forming a rounded helmet shape and a cylindrical body, with tiny stubby arms reaching upwards against the cliff.\"},{\"id\":\"backdrop_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,1000,1000],\"tgt_bbox\":[0,0,1000,1000],\"desc\":\"A soft, out-of-focus expanse of cream ivory and melange indigo knitted yarn, providing a blurred studio backdrop with tangible fiber fuzz catching the ambient light.\"},{\"id\":\"cliff_1\",\"from\":\"ref_image_0\",\"src_bbox\":[300,0,1000,450],\"tgt_bbox\":[300,0,1000,450],\"desc\":\"A steep, uneven cliff face constructed from stacked, thick yarn skeins in rich shades of mustard yellow, terracotta, and melange indigo, featuring visible woven wool textures and loose, stray fiber strands.\"},{\"id\":\"needle_1\",\"from\":\"ref_image_0\",\"src_bbox\":[420,250,550,450],\"tgt_bbox\":[420,250,550,450],\"desc\":\"A real, oversized polished steel tapestry needle, gleaming under the studio lighting. It features a blunt tip and an elongated eye, grasped like a weapon in the knight'"'"'s yarn-stub hand.\"},{\"id\":\"dragon_1\",\"from\":\"ref_image_0\",\"src_bbox\":[100,600,950,1000],\"tgt_bbox\":[100,600,950,1000],\"desc\":\"A large, fluffy knitted dragon made of highly textured, fuzzy yarn in terracotta and mustard yellow. It has a rounded snout, large crocheted eyes, and a wide-open mouth, with visible loose fibers creating a soft, tactile surface.\"},{\"id\":\"fire_1\",\"from\":\"ref_image_0\",\"src_bbox\":[350,400,650,650],\"tgt_bbox\":[350,400,650,650],\"desc\":\"Curled, sculptural puffs of fiery orange angora thread, suspended in mid-air. The thread is highly textured, fuzzy, and chaotic, bursting from the dragon'"'"'s mouth and stretching horizontally across the center.\"}]",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/aa7b28af831835fcef86e770262c8c30fa308c2c-1360x768.webp"
]
}'
{
"id": "<string>",
"polling_url": "<string>",
"cost": 123,
"input_mp": 123,
"output_mp": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, cliffs on one side, turquoise sea on the other, a single vintage car with headlights on, soft golden rim light",
"aspect_ratio": "21:9"
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "change the color of only one bird in the middle to #e01075",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/4792198dfeba9223bf3ecf020fed2942de7f0bd7-1800x1200.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Turn Image 1 in the Style of Image 2",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/ababcf5c9cf86074d71c92d6362ff63545d90661-1800x1201.webp",
"https://cdn.sanity.io/images/2gpum2i6/production/dc642f5b01040c4afc46c1b4f8c4945152932683-1350x1800.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Minimalist graphic illustration featuring a black silhouette of a person <silhouette_1> centered against a solid, vibrant chartreuse background <background_1>. The figure is captured in a dynamic, mid-stride running pose, facing toward the left side of the frame. The image relies entirely on the high-contrast relationship between the two colors, mimicking a digital recreation of a screen-printed or risograph aesthetic, with no discernible light source or shadow. [{\"id\":\"background_1\",\"bbox\":[0,0,1000,1000],\"desc\":\"A flat field of neon yellow-green possessing a subtle, tactile paper texture with fine, organic grain and slight variations in color saturation, giving the flat surface a sense of physical depth.\"},{\"id\":\"silhouette_1\",\"bbox\":[150,150,850,850],\"desc\":\"A black silhouette of a person in motion, composed of a dense, stippled texture that resembles physical ink on paper or a low-resolution digital dither. The leading edges, including the front of the head, chest, and forward leg, are relatively solid and opaque. The trailing edges, such as the back, outstretched rear arm, and lifted back leg, dissolve into a spray of coarse, square-shaped pixels and scattered dots. The black ink shows a slight textural irregularity, as if pressed onto a porous surface.\"}]",
"aspect_ratio": "1:1"
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "In <ref_image_0>, change the large tiger <animal_1> and the small glowing butterfly <insect_1> to be pink. Keep the massive fallen log <log_1>, the falling snow <snow_1>, and the dark background trees <trees_1> exactly unchanged. [{\"id\":\"animal_1\",\"from\":null,\"src_bbox\":null,\"tgt_bbox\":[250,50,850,650],\"desc\":\"Make both pink.\"},{\"id\":\"insect_1\",\"from\":null,\"src_bbox\":null,\"tgt_bbox\":[650,680,750,750],\"desc\":\"Make both pink.\"},{\"id\":\"log_1\",\"from\":\"ref_image_0\",\"src_bbox\":[600,0,1000,1000],\"tgt_bbox\":[600,0,1000,1000],\"desc\":\"A massive, fallen tree log stretching horizontally across the foreground. The surface features deep, rough-textured bark, weathered cracks, and small pockets of frost.\"},{\"id\":\"snow_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,1000,1000],\"tgt_bbox\":[0,0,1000,1000],\"desc\":\"Numerous white snowflakes of varying sizes falling across the scene. Some flakes are sharp and distinct, while others closer to the lens appear as blurred white streaks.\"},{\"id\":\"trees_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,650,1000],\"tgt_bbox\":[0,0,650,1000],\"desc\":\"A dense stand of tall, dark, vertical tree trunks receding into the distance. A cool, blue misty light permeates the spaces between the trees, glowing most intensely from the right edge.\"}]",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/b6476b163e11444d6d5490ac1fa1e610d4eab85e-1360x768.webp"
]
}'
curl --request POST \
--url https://api.bfl.ai/v1/flux-3-image \
--header "x-key: $BFL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "In <ref_image_0>, move the miniature grey amigurumi knight figure <knight_1> upwards and to the left along the yarn cliff <cliff_1>. Leave the polished steel tapestry needle <needle_1> in its original position in the air. Keep the rest of the image completely unchanged, preserving the blurred yarn backdrop <backdrop_1>, the large knitted dragon <dragon_1>, and the fiery orange thread <fire_1> suspended between them. [{\"id\":\"knight_1\",\"from\":\"ref_image_0\",\"src_bbox\":[500,150,850,350],\"tgt_bbox\":[194,55,544,255],\"desc\":\"A miniature amigurumi knight figure crocheted from thick grey woolen yarn. It has visible, intricate stitches forming a rounded helmet shape and a cylindrical body, with tiny stubby arms reaching upwards against the cliff.\"},{\"id\":\"backdrop_1\",\"from\":\"ref_image_0\",\"src_bbox\":[0,0,1000,1000],\"tgt_bbox\":[0,0,1000,1000],\"desc\":\"A soft, out-of-focus expanse of cream ivory and melange indigo knitted yarn, providing a blurred studio backdrop with tangible fiber fuzz catching the ambient light.\"},{\"id\":\"cliff_1\",\"from\":\"ref_image_0\",\"src_bbox\":[300,0,1000,450],\"tgt_bbox\":[300,0,1000,450],\"desc\":\"A steep, uneven cliff face constructed from stacked, thick yarn skeins in rich shades of mustard yellow, terracotta, and melange indigo, featuring visible woven wool textures and loose, stray fiber strands.\"},{\"id\":\"needle_1\",\"from\":\"ref_image_0\",\"src_bbox\":[420,250,550,450],\"tgt_bbox\":[420,250,550,450],\"desc\":\"A real, oversized polished steel tapestry needle, gleaming under the studio lighting. It features a blunt tip and an elongated eye, grasped like a weapon in the knight'"'"'s yarn-stub hand.\"},{\"id\":\"dragon_1\",\"from\":\"ref_image_0\",\"src_bbox\":[100,600,950,1000],\"tgt_bbox\":[100,600,950,1000],\"desc\":\"A large, fluffy knitted dragon made of highly textured, fuzzy yarn in terracotta and mustard yellow. It has a rounded snout, large crocheted eyes, and a wide-open mouth, with visible loose fibers creating a soft, tactile surface.\"},{\"id\":\"fire_1\",\"from\":\"ref_image_0\",\"src_bbox\":[350,400,650,650],\"tgt_bbox\":[350,400,650,650],\"desc\":\"Curled, sculptural puffs of fiery orange angora thread, suspended in mid-air. The thread is highly textured, fuzzy, and chaotic, bursting from the dragon'"'"'s mouth and stretching horizontally across the center.\"}]",
"images": [
"https://cdn.sanity.io/images/2gpum2i6/production/aa7b28af831835fcef86e770262c8c30fa308c2c-1360x768.webp"
]
}'
Authorizations
Body
Free-form prompt describing the image.
Optional reference image(s) the prompt edits or draws from; each is an http(s) URL or base64, one to 10 total.
Output aspect ratio. Under auto a ratio the prompt asks for wins, otherwise the output keeps the first reference image's framing; without references the prompt decides, else 1:1.
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 Image resolution class, an equal-pixel-area tier: 768sq, 1k, 1.5k, 2k, or 4k. Exact dimensions vary with the aspect ratio.
768sq, 1k, 1.5k, 2k, 4k Tolerance level for input and output harm moderation. Between 0 and 4, with 0 the strictest.
0 <= x <= 4When true (default) the prompt may be grounded in external research: web search and image search. When false, both are off.
Endpoint version. latest (default) serves the current release; dated pinnable release tags are added here as they are published.
"latest"Was this page helpful?

