Generate or edit one image
curl --request POST \
--url https://gengen.farm/api/gengen/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "flux-3-image",
"prompt": "<string>"
}
'import requests
url = "https://gengen.farm/api/gengen/v1/images/generations"
payload = {
"model": "flux-3-image",
"prompt": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'flux-3-image', prompt: '<string>'})
};
fetch('https://gengen.farm/api/gengen/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"model": "flux-3-image",
"status": "succeeded",
"outputs": {
"images": [
"<string>"
]
}
}Black Forest Labs
Generate images with FLUX 3
Generate or edit one image with FLUX 3 Image. Choose a resolution tier, set an exact size, or match a reference image.
POST
/
images
/
generations
Generate or edit one image
curl --request POST \
--url https://gengen.farm/api/gengen/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "flux-3-image",
"prompt": "<string>"
}
'import requests
url = "https://gengen.farm/api/gengen/v1/images/generations"
payload = {
"model": "flux-3-image",
"prompt": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'flux-3-image', prompt: '<string>'})
};
fetch('https://gengen.farm/api/gengen/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"model": "flux-3-image",
"status": "succeeded",
"outputs": {
"images": [
"<string>"
]
}
}Send a prompt to
POST /api/gengen/v1/images/generations with model flux-3-image. The request waits for one image. Download it promptly from outputs.images[0]. This is the original signed BFL URL, and BFL controls when it expires.
curl https://gengen.farm/api/gengen/v1/images/generations \
-H "Authorization: Bearer $GENGEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "flux-3-image",
"prompt": "A woodcut illustration of a heron by a lake at dusk",
"controls": {"size": "1k", "aspectRatio": "3:2"}
}'
Edit with reference images
Pass up to ten publicly accessible HTTP(S) image URLs inassets.referenceImages. Signed URLs work while valid. Refer to images by position in the prompt. The following request keeps the first image’s framing and disables search grounding.
{
"model": "flux-3-image",
"prompt": "Keep the ceramic bowl in image 1 and apply the glaze pattern from image 2.",
"assets": {"referenceImages": ["https://example.com/bowl.png", "https://example.com/glaze.jpg"]},
"controls": {"size": "match_input"},
"providerOptions": {"bfl": {"grounding": false}}
}
Size and billing
controls.size defaults to 1k. The five price tiers are 768sq, 1k, 1.5k, 2k, and 4k. Reference images are included in the per-image rate. See pricing for customer rates.
Use match_input with a reference to match its size up to 4 megapixels. For exact dimensions, supply both controls.width and controls.height, each from 256 to 6256 pixels. Their product must be at most 16,822,272 pixels for text-to-image or 4,194,304 for edits. Exact dimensions take precedence over size and aspect ratio. For custom sizes and match_input, the wallet reserves up to the highest applicable tier price and settles the billed tier.
The model supports search grounding by default. Set providerOptions.bfl.grounding to false to disable it. The accepted range for safetyTolerance is 0–7, subject to the account’s permitted levels.Authorizations
Body
application/json