Flux 2 Flex API
Flux 2 Flex API reference: Black Forest Labs' FLUX.2 [flex], tuned for typography and fine detail. Generate or edit 1MP images with up to 8 references.
- Model id
flux-2-flex- Price
- 14 credits / image
- Output
- 1MP
- Reference images
- Up to 8
- Typical time
- 10–15 seconds
Aspect ratios
/api/v1/generations14 credits per image at every quality setting. Each reference image adds 5 credits, the first one included. Check credits_refunded to confirm a refund; unresolved submissions may require review.
Authorization
AuthorizationstringrequiredBearer fx1_live_… — send your API key in the request header. Requires a completed paid purchase; new generations also require enough credits.
Idempotency-KeystringoptionalUse one unique value per generation and reuse it with the same body on retries. Printable ASCII, no spaces. A different body with the same key returns 409.
Maximum length: 128 characters
Request body
modelstringrequiredUse this exact model ID in the top-level request body.
flux-2-flexpromptstringrequiredDescribe the image to create, or the changes to make to your reference images. Whitespace is trimmed.
Maximum length: 5,000 characters
imagesstring[]optionalOptional reference images. Use publicly accessible HTTPS URLs or data:image/* base64 URIs (up to 20,000,000 characters per entry). Omit for text-to-image.
Maximum items: 8
aspect_ratiostringoptionalOutput width-to-height ratio. Auto lets the model choose.
Default: 1:1
auto1:14:33:416:99:163:22:321:99:21Response & next step
A successful submission returns 202 and a generation id. Poll GET /api/v1/generations/{id} every 2–3 seconds until the status is succeeded or failed.
Read the result URL from output.images[0].url. Download it before expires_at (30 days after storage). On failure, inspect error and credits_refunded.
Model notes
flux-2-flexis FLUX.2 [flex] from Black Forest Labs, released 2025-11-25 with FLUX.2 Pro and Dev. It is tuned for small text and fine detail.- Output is sold at 1 megapixel (about 1,000 px on the short side), so there is no
resolutionfield. Larger tiers, steps and guidance are not exposed; the model runs at its default settings. - Every reference image is billed, the first one included: each adds
pricing.image_credits, because the provider charges for each input image. A text-to-image request has no reference fee. Repeated URLs are sent and billed once. aspect_ratiotakesauto,1:1,4:3,3:4,16:9,9:16,3:2,2:3,21:9or9:21. Custom pixel sizes from the web generator are not available here.- Fields this model does not use are ignored.
Flux 2 Flex API FAQ
How much does the Flux 2 Flex API cost?
14 credits per image. Each reference image adds 5 credits, the first one included. Credits are taken when the submission starts and refunded automatically if the provider rejects it or the generation fails. The API spends the same balance as the web app; see Credits.
How do I get a Flux 2 Flex API key?
Any account with a completed paid credit-pack or subscription purchase can create keys under Settings → API Keys. Send the key as Authorization: Bearer <key> and set "model": "flux-2-flex". The same key works for every model in this API.
Is there a free Flux 2 Flex API?
No. Free or gifted credits alone do not unlock API keys, and every request spends credits. To try the model before paying, use the Flux 2 Flex web generator.
Can I call the Flux 2 Flex API from Python?
Yes. It is a plain HTTPS and JSON API, so no SDK is needed. The request builder above shows this call in cURL, Node.js and Python, and the Quick start has a complete Python script that submits a generation and polls it until it finishes.
Is Flux 2 Flex open source? Can I download it?
No. Black Forest Labs offers FLUX.2 [flex] through its own API, its playground and launch partners, and has not published its weights. The open-weight members of the family are FLUX.2 [dev], a 32B model on Hugging Face under the FLUX non-commercial license, and the smaller FLUX.2 [klein] models.
How does Flux 2 Flex compare with FLUX.2 Pro and Dev?
Black Forest Labs positions FLUX.2 [pro] for top quality at speed, FLUX.2 [flex] for control over steps and guidance with the strongest small-text rendering, and FLUX.2 [dev] as its open-weight model. Flux 2 Flex is the only FLUX.2 model in this API, and it runs at its default steps and guidance.