APIMart
FLUX.2 model icon
Image

FLUX.2 API

FLUX.2 is a three-model image generation and editing family: Pro balances speed, quality, and cost for production, Max targets the highest output quality, and Flex adds adjustable steps and guidance for fine control and typography.

Image GenerationImage EditingCommercial Use

Service Highlights

  • Official Discounts
  • Pay-as-you-go
  • Fast & Low Latency
Input
2
Output
Generated 1

Image link valid for 72 hours

FLUX.2 API Pricing

FLUX.2 billing adds the output MP price to the reference-image MP price.

Output image

Output billing uses the 1MP, 2MP, 3MP, and 4MP tiers.

Output image. Output billing uses the 1MP, 2MP, 3MP, and 4MP tiers.
VariantTierGoldCurrent pricePlatinumDiamondOfficialYour savings
flux-2-pro1MP0.24Credits(~$0.024)0.228Credits(~$0.0228)0.216Credits(~$0.0216)0.3Credits(~$0.03)20%
2MP0.36Credits(~$0.036)0.342Credits(~$0.0342)0.324Credits(~$0.0324)0.45Credits(~$0.045)20%
3MP0.48Credits(~$0.048)0.456Credits(~$0.0456)0.432Credits(~$0.0432)0.6Credits(~$0.06)20%
4MP0.6Credits(~$0.06)0.57Credits(~$0.057)0.54Credits(~$0.054)0.75Credits(~$0.075)20%
flux-2-max1MP0.56Credits(~$0.056)0.532Credits(~$0.0532)0.504Credits(~$0.0504)0.7Credits(~$0.07)20%
2MP0.8Credits(~$0.08)0.76Credits(~$0.076)0.72Credits(~$0.072)1Credits(~$0.1)20%
3MP1.04Credits(~$0.104)0.988Credits(~$0.0988)0.936Credits(~$0.0936)1.3Credits(~$0.13)20%
4MP1.28Credits(~$0.128)1.216Credits(~$0.1216)1.152Credits(~$0.1152)1.6Credits(~$0.16)20%
flux-2-flex1MP0.4Credits(~$0.04)0.38Credits(~$0.038)0.36Credits(~$0.036)0.5Credits(~$0.05)20%
2MP0.8Credits(~$0.08)0.76Credits(~$0.076)0.72Credits(~$0.072)1Credits(~$0.1)20%
3MP1.2Credits(~$0.12)1.14Credits(~$0.114)1.08Credits(~$0.108)1.5Credits(~$0.15)20%
4MP1.6Credits(~$0.16)1.52Credits(~$0.152)1.44Credits(~$0.144)2Credits(~$0.2)20%

Reference images

A single reference image uses its actual pixel tier, up to 4MP. With two or more images, each is billed at 1MP.

Reference images. A single reference image uses its actual pixel tier, up to 4MP. With two or more images, each is billed at 1MP.
VariantTierGoldCurrent pricePlatinumDiamondOfficialYour savings
flux-2-pro1MP0.12Credits(~$0.012)0.114Credits(~$0.0114)0.108Credits(~$0.0108)0.15Credits(~$0.015)20%
2MP0.24Credits(~$0.024)0.228Credits(~$0.0228)0.216Credits(~$0.0216)0.3Credits(~$0.03)20%
3MP0.36Credits(~$0.036)0.342Credits(~$0.0342)0.324Credits(~$0.0324)0.45Credits(~$0.045)20%
4MP0.48Credits(~$0.048)0.456Credits(~$0.0456)0.432Credits(~$0.0432)0.6Credits(~$0.06)20%
flux-2-max1MP0.24Credits(~$0.024)0.228Credits(~$0.0228)0.216Credits(~$0.0216)0.3Credits(~$0.03)20%
2MP0.48Credits(~$0.048)0.456Credits(~$0.0456)0.432Credits(~$0.0432)0.6Credits(~$0.06)20%
3MP0.72Credits(~$0.072)0.684Credits(~$0.0684)0.648Credits(~$0.0648)0.9Credits(~$0.09)20%
4MP0.96Credits(~$0.096)0.912Credits(~$0.0912)0.864Credits(~$0.0864)1.2Credits(~$0.12)20%
flux-2-flex1MP0.4Credits(~$0.04)0.38Credits(~$0.038)0.36Credits(~$0.036)0.5Credits(~$0.05)20%
2MP0.8Credits(~$0.08)0.76Credits(~$0.076)0.72Credits(~$0.072)1Credits(~$0.1)20%
3MP1.2Credits(~$0.12)1.14Credits(~$0.114)1.08Credits(~$0.108)1.5Credits(~$0.15)20%
4MP1.6Credits(~$0.16)1.52Credits(~$0.152)1.44Credits(~$0.144)2Credits(~$0.2)20%

* Final charges follow the actual generation parameters.

FLUX.2 API — Pro, Max & Flex

Generate or edit images with FLUX.2 Pro, Max, and Flex. Every variant accepts up to 8 reference images as public URLs or Base64, supports 1MP, 2MP, 3MP, and 4MP tiers, and can use exact dimensions up to 4 MP.

50K+

Active Users

99.9%

Uptime

2x

Faster

20%

1MP Output · Saving

FLUX.2 API Example: Text to Image and Image Editing

Call flux-2-pro with one POST request. Generation is asynchronous: submit a task, then poll the task endpoint for the image URL.

  1. 1

    Authenticate FLUX.2 API requests

    Save your APIMart key in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.

  2. 2

    Submit a FLUX.2 task

    POST /v1/images/generations with model flux-2-pro, your prompt, resolution and size. Add image_urls to edit or combine references. Add steps and guidance only for flux-2-flex. The example.com URLs are placeholders: replace them with your own publicly accessible images or Base64 data. The task ID is in data[0].task_id.

  3. 3

    Get the FLUX.2 result

    Poll GET /v1/tasks/{task_id} until status is completed, then read the image URL from data.result.images[0].url[0]. APIMart keeps results for 72 hours, so download the images you want to keep.

    See the FLUX.2 API reference for every parameter, size rule and response field.

POST /v1/images/generations
curl -X POST https://api.apimart.ai/v1/images/generations \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2-pro",
    "prompt": "A minimalist skincare product on a travertine stone, soft side light, clean beige background, studio product photo",
    "resolution": "2MP",
    "size": "16:9",
    "output_format": "jpeg"
  }'

FLUX.2 API Parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredDefault: flux-2-proflux-2-pro, flux-2-max or flux-2-flex.
promptstringRequiredDefault: —Describe the image to generate or the edit to apply to the reference images.
resolutionstringOptionalDefault: 2MP1MP, 2MP, 3MP or 4MP output tier.
sizestringOptionalDefault: 1:11:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 9:21, auto (follow the reference) or a pixel string such as 1024x1536.
widthintegerOptionalDefault: —Exact width in pixels, at least 64. Send together with height; the pair overrides resolution and size.
heightintegerOptionalDefault: —Exact height in pixels, at least 64. width × height must not exceed 4 MP.
image_urlsstring[]OptionalDefault: —Up to 8 reference images as public URLs or Base64. Output plus all references must stay within 9 MP.
output_formatstringOptionalDefault: jpegjpeg, png or webp.
seedintegerOptionalDefault: —Reuse the same seed and parameters for reproducible output; omit for a random seed.
prompt_upsamplingbooleanOptionalDefault: falseLet the model enhance and rewrite the prompt before generation.
safety_toleranceintegerOptionalDefault: 20 (strictest) to 5.
nsfw_checkbooleanOptionalDefault: falseReview the prompt and input images with omni-moderation-latest before submission.
stepsintegerOptionalDefault: 50Sampling steps from 1 to 50; more steps add detail but take longer. Only flux-2-flex accepts it.
guidancenumberOptionalDefault: 5.0Prompt guidance from 1.5 to 10; higher values follow the prompt more closely. Only flux-2-flex accepts it.

Compare FLUX API Models on APIMart

One APIMart API key calls every FLUX model below. Image models are billed per image and FLUX 3 Video per second of video.

ModelBest forOutput
FLUX 3 Image APIThe FLUX 3 API for images: generation and editing with up to 10 references, search grounding and output up to 4K768sq to 4K (about 16 MP)
FLUX 3 Image Klein APILower-cost FLUX 3 images with seed, 1–16 steps and PNG or JPEG output768sq to 4K (about 16 MP)
FLUX 3 Video APIText to video, 1–10 keyframes, video continuation and drafts, with synced audioHD or FHD, 5–20 s
FLUX.2 APIThis pageChoosing between FLUX.2 Pro, Max and Flex on one page1–4 MP
FLUX.2 Pro APIBalanced quality and cost for production images, up to 8 references1–4 MP
FLUX.2 Max APIThe highest-quality FLUX.2 output, up to 8 references1–4 MP
FLUX.2 Flex APIAdjustable steps and guidance for typography and layout-heavy designs1–4 MP
FLUX.1 Kontext APIChoosing between FLUX.1 Kontext Pro and Max on one pageAbout 1 MP
FLUX.1 Kontext Pro APIContext-aware edits at a fixed price per image, up to 4 referencesAbout 1 MP
FLUX.1 Kontext Max APIHigher-quality Kontext edits with stronger prompt adherenceAbout 1 MP

Guides, comparisons and pricing analysis from the APIMart blog.