FLUX image API
Generate and edit images with FLUX.2, Kontext, and FLUX 3.
Use an Official Group API key with https://app.apipool.dev. Each generation or edit creates an asynchronous task for one image. Poll until completed to get the image URL.
Models and pricing
Kontext and FLUX 3 rates are in US dollars per delivered image. References are free for these models. FLUX.2 prices references separately. Failed tasks are free.
| Model ID | 768sq | 1K | 1.5K | 2K | 4K |
|---|---|---|---|---|---|
flux-3-image | 0.041 | 0.048 | 0.070 | 0.100 | 0.607 |
flux-3-image-klein | 0.008 | 0.009 | 0.011 | 0.014 | 0.036 |
flux-kontext-pro costs US$0.04 per image and flux-kontext-max costs US$0.08. Both output approximately 1 MP.
FLUX.2 pricing and limits
| Model ID | 1 MP output | 2 MP output | 3 MP output | 4 MP output | Per reference |
|---|---|---|---|---|---|
flux-2-flex | 0.05 | 0.10 | 0.15 | 0.20 | 0.05 |
flux-2-pro | 0.03 | 0.045 | 0.06 | 0.075 | 0.015 |
flux-2-max | 0.07 | 0.10 | 0.13 | 0.16 | 0.03 |
FLUX.2 supports 1MP, 2MP (default), 3MP, and 4MP output. Submit up to eight single-frame references with a maximum of 1,048,576 pixels per reference. The output MP tier plus the number of references cannot exceed nine. Use file uploads or Base64 data URLs for references. Exact pixel dimensions and external URLs are unavailable for FLUX.2. Each task bills the output tier plus the reference charges.
FLUX.2 uses the same aspect ratios as Kontext. All three models accept seed from 0 to 4,294,967,295, prompt_upsampling, safety_tolerance from 0 to 5, and output_format of PNG, JPEG, or WebP. Flex also accepts steps from 1 to 50 (default 50) and guidance from 1.5 to 10 (default 5).
Generate and edit
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-3-image-klein","prompt":"A blue ceramic cup on a white table","aspect_ratio":"1:1","resolution":"1k","seed":0,"steps":16}'For an edit, supply image_urls and describe the desired changes. Kontext and FLUX 3 accept public HTTP(S) URLs or PNG, JPEG, and WebP Base64 data URLs. Kontext accepts up to four references and FLUX 3 up to ten. Alternatively, upload multipart image files to /v1/images/edits. Upload limits are 10 MB per image and 48 MB in total.
curl https://app.apipool.dev/v1/images/edits \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-F model=flux-kontext-pro \
-F prompt='Keep the shape of the cup and change its color to blue' \
-F size=1:1 -F [email protected]Parameters
promptis required and accepts 1–4,000 characters. Describe region or layout changes in the prompt. Mask uploads are unavailable.nis fixed at1.- For Kontext,
sizeacceptsauto,1:1,4:3,3:4,16:9,9:16,3:2,2:3,21:9, and9:21. Exact pixel dimensions are unavailable. - FLUX 3 also accepts
2:1,7:5,5:4,4:5,5:7, and1:2. Provide eitheraspect_ratioorsize. - FLUX 3 accepts
768sq,1k(default),1.5k,2k, and4kforresolution. For Kontext, omitresolutionor use1MP. - Kontext and Klein accept integer
seedfrom 0 to 4,294,967,295. Klein acceptsstepsfrom 1 to 16 (default 16). FLUX 3 Image accepts neither field. - Kontext accepts
png,jpeg, orwebpforoutput_format. Klein acceptsjpegorpng. FLUX 3 Image has no output-format option. safety_tolerancedefaults to 2. Kontext accepts 0–6 and FLUX 3 accepts 0–4.- Kontext accepts boolean
prompt_upsampling(defaultfalse). FLUX 3 Image accepts booleangrounding(defaulttrue). Klein accepts neither field.
Results and troubleshooting
Use the returned task ID and the same API key with GET /v1/tasks/{task_id}. Keep checking the original task while it processes. Save the image when it completes. Query again for a fresh link while the result is retained.
HTTP 400 can indicate unsupported, repeated, or out-of-range parameters. HTTP 402 indicates an insufficient balance. For an unreadable reference URL, check its expiry and access restrictions. Read the task error before changing and resubmitting a failed request.
Try Kontext Pro, Kontext Max, FLUX 3 Image, or Klein.