FLUX.2 Pro API

FLUX.2 [pro]: production photorealism and up to 8-reference editing, billed per megapixel.

Black Forest Labs·ImageAvailable

from$0.022/ image$0.02510% off

Model IDflux-2-pro

text-to-imageimage-edit

Input

Text · Image

Output

Image

Provider

5 providers

Aspect ratio

1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3

Resolution

1K · 2K

Seed

0 – 2147483647

Last 7 days · not enough recent requests for stats yet.

FLUX.2 Pro pricing

Prices are per unit; requests without a provider are routed to the cheapest provider that supports your parameters.

Option1K2K
All options
$0.022 / image
3 Credits$0.02510% off
$0.032 / image
4 Credits$0.03510% off

Try FLUX.2 Pro before you integrate

Test output quality, compare provider prices and estimate cost before writing any code.

Provider
Image
Estimated cost

Input

prompt
image_urls
aspect_ratio
resolution
seed

Result

Idle
Your generation will appear here.

Provider prices for this request

Enter a prompt to compare provider prices.

FLUX.2 Pro prompt examples

Ready-to-use prompts. Load one into the playground and tweak it.

Source
Scene

17 prompts

A photograph of a vintage, beige CRT monitor sitting on a cluttered wooden desk in a d

A photograph of a vintage, beige CRT monitor sitting on a cluttered wooden desk in a dimly lit room. The curved screen glows with monochromatic green text. Displayed on the screen is Python code: import flux_api def generate_image(prompt): print(f"Processing: {prompt}") # Connecting to core... return True Below the code, a blinking cursor sits next to a command prompt: `user@retro-pc:~/dev$ _`. The screen shows scan lines, slight flickering distortion, and reflections of the room lights on the curved glass surface. A mechanical keyboard with beige and grey keycaps sits in front of it. Film grain.

A girl taking a mirror selfie in a bathroom. She is holding an iPhone in her right han

A girl taking a mirror selfie in a bathroom. She is holding an iPhone in her right hand. We see her back in the foreground, and her front reflection in the mirror. The phone screen in the reflection is visible and displays a text message bubble saying "I AM AI". The focus is on the reflection in the mirror. The background shows tiled walls and towels. The geometry of the reflection must perfectly match her pose.

A nature photograph captures a defensive standoff between a North American porcupine a

A nature photograph captures a defensive standoff between a North American porcupine and a nine-banded armadillo in a dry, rocky riverbed. The porcupine is turned away, with hundreds of long, sharp quills fully erected, creating a textured defensive halo. The armadillo is curled halfway into a ball, showing the intricate, leathery texture of its armored bands and scales. Dust is kicking up slightly around them. Harsh afternoon sunlight casting long shadows. Sharp focus on the textures of both animals.

A comic book page layout drawn in a gritty noir graphic novel style with heavy black i

A comic book page layout drawn in a gritty noir graphic novel style with heavy black ink shadows. The page is divided into three horizontal panels separated by white gutters. Top Panel: A close-up of detective's eyes looking suspicious through blinds. Text bubble says "HE'S LATE." Middle Panel: A wide shot of a rainy, dark alleyway with a single figure standing under a streetlamp. Sound effect text "TIP TAPTIP TAP" near their feet. Bottom Panel: A gloved hand holding a smoking revolver. Text bubble says "...TOO LATE." The art style is consistent across all panels.

A symmetrical studio photograph of two identical, transparent glass chemical flasks si

A symmetrical studio photograph of two identical, transparent glass chemical flasks sitting side-by-side on a white laboratory bench. The LEFT flask contains a clear, still blue liquid and has a label reading "SOLUTION A: STABLE". The RIGHT flask contains the same blue liquid, but it is vigorously bubbling and boiling, with steam rising from the neck. It has an identical label that reads "SOLUTION B: REACTING". The lighting is clean and clinical. The focus must clearly show the difference in the liquid's state.

FLUX.2 Pro API reference

Endpoints, request fields and runnable examples for this model.

Base URL

https://01router.com/api/v1
llms.txt

Quick start

Set API_KEY to your project key, then run a sample from your server. Replace example media URLs with your own public URLs.

Auto-routing chooses a provider that supports the request. Select a provider to see its input constraints and pinned request examples.

curl https://01router.com/api/v1/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "flux-2-pro",
  "input": {
    "prompt": "A cinematic shot of a red fox running through snow",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }
}
JSON

# Replace GENERATION_ID with the id returned above; poll until status is "succeeded" or "failed"
curl https://01router.com/api/v1/generations/GENERATION_ID -H "Authorization: Bearer $API_KEY"

Endpoints

Only endpoints relevant to this model are listed. Paths below include /api/v1. Click an endpoint to read its usage.

Authentication

Send your API key as a Bearer token. Requests are billed to the key owner's credits.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Get an API key

Input

Send JSON with Content-Type: application/json. Model parameters belong inside input; model, provider and callback_url are top-level fields.

Request body

NameTypeRequiredDescription
modelstringYes"flux-2-pro"
providerstringNoPin a provider; omit to auto-route to the cheapest. One of: fal | replicate | wavespeed | kie | atlascloud
inputobjectYesModel parameters, see the input fields below.
callback_urlstringNoOptional public HTTPS webhook URL. The final task result is signed and delivered here; polling remains available.

input · input fields

Required fields are marked explicitly. Other fields use the listed defaults when omitted.

NameTypeRequiredValuesDefault
prompt*stringYes——
image_urls
Optional — switches to image editing
string[]NomaxItems: 8—
aspect_ratiostringNo1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 3:2 | 2:31:1
resolutionstringNo1K | 2K1K
seedintegerNomin: 0 · max: 2147483647—
Callbacks →

Output

Creating a task does not mean generation has finished. Keep its id, poll until succeeded or failed, then read outputs or error. Amounts below are illustrative; actual charges depend on the request.

queued→processing→succeeded / failed

Task submitted

{
  "id": "gen_example",
  "object": "generation",
  "model": "flux-2-pro",
  "type": "image",
  "provider": "fal",
  "status": "processing",
  "input": {
    "prompt": "A cinematic shot of a red fox running through snow",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  },
  "outputs": [],
  "error": null,
  "credits": 0,
  "price_usd": 0,
  "created_at": "2026-10-25T08:00:00.000Z",
  "completed_at": null
}

Task completed

{
  "id": "gen_example",
  "object": "generation",
  "model": "flux-2-pro",
  "type": "image",
  "provider": "fal",
  "status": "succeeded",
  "input": {
    "prompt": "A cinematic shot of a red fox running through snow",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  },
  "outputs": [
    "https://example.com/output.png"
  ],
  "error": null,
  "credits": 0,
  "price_usd": 0,
  "created_at": "2026-10-25T08:00:00.000Z",
  "completed_at": "2026-10-25T08:01:00.000Z"
}

Response fields

NameTypeRequiredDescription
idstringYesGeneration ID. Use it to query or cancel this task.
objectstringYesgeneration
modelstringYesflux-2-pro
typestringYesimage
providerstringYesProvider
statusstringYesqueued → processing → succeeded / failed. Stop polling at either terminal state.
inputobjectYesModel parameters, see the input fields below.
outputsstring[]YesResult URLs. Empty while processing; read after succeeded and save the files promptly.
errorstring | nullYesFailure reason, or null when no failure is reported.
creditsnumberYesCredits charged for this request.
price_usdnumberYesRequest price in USD.
created_atstringYesCreation time in ISO 8601 format.
completed_atstring | nullYesCompletion time in ISO 8601 format; null before completion.

Get the result

Poll every few seconds until status is succeeded or failed. Output URLs are provider-hosted and may expire — download them promptly. Or pass callback_url to get the result pushed.

curl "https://01router.com/api/v1/generations/GENERATION_ID" \
  -H "Authorization: Bearer $API_KEY"

queued → processing → succeeded / failed. Stop polling at either terminal state. Result URLs. Empty while processing; read after succeeded and save the files promptly.

Cancel a task

Cancellation depends on provider support and task state. A confirmed cancellation returns status: failed and error: Canceled by user. Unsupported or completed tasks return 409 not_cancelable.

curl -X POST "https://01router.com/api/v1/generations/GENERATION_ID/cancel" \
  -H "Authorization: Bearer $API_KEY"

Quote

Same body as creating a generation. Returns every available provider sorted by price, plus the ones that cannot serve the request and why.

curl "https://01router.com/api/v1/quote" -H "Content-Type: application/json" --data-binary @- <<'JSON'
{
  "model": "flux-2-pro",
  "input": {
    "prompt": "A cinematic shot of a red fox running through snow",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }
}
JSON

OpenAI-compatible images

For OpenAI SDK integrations, use this endpoint with top-level prompt. It waits for the result and returns data[].url. For asynchronous tasks and the full model parameter set, use /generations.

curl "https://01router.com/api/v1/images/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" --data-binary @- <<'JSON'
{
  "model": "flux-2-pro",
  "prompt": "A cinematic shot of a red fox running through snow"
}
JSON
{
  "created": 1792915200,
  "data": [
    {
      "url": "https://example.com/output.png"
    }
  ]
}

Model schema

This public endpoint returns the model parameters and each provider’s supported constraints and prices.

curl "https://01router.com/api/v1/models/flux-2-pro"

Errors

Check the HTTP status and error.message. Fix the request before retrying validation or authentication errors. A failed generation is reported in status and error on the task itself.

{
  "error": {
    "message": "Invalid or missing API key",
    "code": "unauthorized"
  }
}

400Invalid body or parameter value

401Missing or invalid API key

402Not enough credits

404Unknown model or generation

409The task cannot be canceled (already finished, or the provider does not support canceling)

429Too many requests — retry after the given seconds

502Every provider rejected the task (credits refunded)

Auth, routing, billing and error codes are covered in →

Use with AI

Give your coding assistant this model reference: endpoints, input constraints, output fields and request examples in plain text.

Open llms.txt

How does FLUX.2 Pro compare?

Specs and starting prices side by side. Test with the same prompt before you choose.

FLUX.2 ProGPT Image 2.5 FlareGPT Image 2.5 SunburstNano Banana 2.1
VendorBlack Forest LabsOpenAIOpenAIGoogle
Starting price$0.022 / image$0.0053 / image$0.0053 / image$0.018 / image
InputText · ImageText · ImageText · ImageText · Image
Provider5 providers6 providers6 providers8 providers
Aspect ratio1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:31:1 · 4:3 · 3:4 · 16:9 · 9:16 · 3:2 · 2:31:1 · 4:3 · 3:4 · 16:9 · 9:16 · 3:2 · 2:31:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 4:5 · 5:4 · 21:9
Resolution1K · 2K——1K · 2K · 4K
Seed0 – 2147483647———

FLUX.2 Pro API FAQ

What is FLUX.2 Pro good at?

Black Forest Labs' FLUX.2 Pro delivers production-grade images with strong typography, exact colour matching from hex codes and precise left/right composition, with no steps or guidance to tune.

Can I edit with reference images?

Yes. Add reference images in image_urls (up to 8 on most providers) and describe the edit, for example replacing the background or combining products.

Does it support negative prompts?

No. Describe what you want positively instead; structured prompts (even JSON) work well.

What output sizes are available?

1K or 2K with aspect ratios from 1:1 to 16:9. Use a seed to reproduce a result.

How is it billed on 01router?

Per generated image; see the pricing table for each provider. Failed generations are refunded.

Related models

Other models you can call with the same API key.