Flux 2 Pro icon

Flux 2 Pro API

Generate high-quality AI images with Black Forest Labs' Flux 2 Pro through one unified API. A single REST endpoint, async jobs, and webhooks, with no separate provider account to manage.

Integrate Flux 2 Pro with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.

model: "flux-2-pro"
Flux 2 Pro photorealistic electric SUV on a coastal highway at golden hour with cinematic lighting and sharp reflections

What's special about Flux 2 Pro

Frontier photorealism

It produces realistic lighting and physics that reduce the typical "AI look," making it strong for commercial-grade imagery.

Multi-reference consistency

It can take up to 10 reference images at once and hold a consistent character, product, or style across every output.

A large context window

A 32k-token context lets it follow long, detailed, multi-part prompts without losing the thread.

Accurate text rendering

It renders clean, legible typography even at small sizes, which makes it dependable for posters, infographics, and UI.

Unified generation and editing

The same model both creates images from text and edits existing ones at up to 4MP while preserving detail.

Production-ready speed and pricing

It generates in under 10 seconds with automatic prompt enhancement, at 6 credits ($0.06) per image at 1MP, scaling up to 14 credits ($0.14) at 4MP.

Made with Flux 2 Pro

A few outputs generated through the Flux 2 Pro API on Apiframe.

Flux 2 Pro brand-consistent set of the same mascot character waving, working at a desk, and holding a coffee cup in a unified style

Using these reference images of our mascot, show the same character waving, working at a desk, and holding a coffee cup, in a consistent style.

Flux 2 Pro photorealistic electric SUV on a coastal highway at golden hour with cinematic lighting and sharp reflections

A photorealistic electric SUV on a coastal highway at golden hour, cinematic lighting, sharp reflections.

Flux 2 Pro event poster reading 'SUMMER SOUND FESTIVAL' with modern typography, date and venue beneath, on a bold gradient background

An event poster reading 'SUMMER SOUND FESTIVAL' with modern type, date and venue beneath, bold gradient background.

Flux 2 Pro editorial product photo of a matte black ceramic mug on sunlit marble with morning light through linen curtains

A matte black ceramic mug on sunlit marble, morning light through linen curtains, editorial product style.

Flux 2 Pro image edit replacing a product photo background with a soft studio gradient while keeping the product identical

Replace the plain background in this product photo with a soft studio gradient, keeping the product identical.

Flux 2 Pro cozy home office with a wooden desk, laptop, a steaming mug on the left, and a potted monstera on the right in warm afternoon light

A cozy home office: wooden desk with a laptop, a steaming mug on the left, a potted monstera on the right, warm afternoon light.

Overview

Endpoint
POST /v2/images/generate
Model ID
flux-2-pro
Params key
fluxParams
Modality
Image
Provider
Black Forest Labs
Avg. completion
~15s

Capabilities

Aspect ratios1:1, 3:4, 4:3, 9:16, 16:9
Resolutions0.5MP, 1MP, 2MP, 4MP
Image inputSupported
Avg. time~15s

Quick start

Send a single POST /v2/images/generate request with your API key to generate with Flux 2 Pro. The call returns a jobId you can poll or receive via webhook.

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "flux-2-pro",
        "fluxParams": {
            "resolution": "2MP",
            "image_prompt": "https://example.com/input.jpg",
            "image_prompt_strength": 0.5,
            "output_format": "jpg"
        }
    }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/images/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "flux-2-pro",
        "fluxParams": {
            "resolution": "2MP",
            "image_prompt": "https://example.com/input.jpg",
            "image_prompt_strength": 0.5,
            "output_format": "jpg"
        }
    },
)
print(response.json())  # { "jobId": "...", "status": "QUEUED" }
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
    "model": "flux-2-pro",
    "fluxParams": {
      "resolution": "2MP",
      "image_prompt": "https://example.com/input.jpg",
      "image_prompt_strength": 0.5,
      "output_format": "jpg"
    }
  }),
});
const { jobId } = await response.json();
console.log(jobId);

Response & job lifecycle

Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).

1. Submission response (202)

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "status": "QUEUED"
}

2. Poll for the result

curl https://api.apiframe.ai/v2/jobs/JOB_ID \
  -H "X-API-Key: afk_your_api_key_here"
import requests, time

while True:
    job = requests.get(
        "https://api.apiframe.ai/v2/jobs/JOB_ID",
        headers={"X-API-Key": "afk_your_api_key_here"},
    ).json()
    if job["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(2)
print(job["result"])
let job;
do {
  await new Promise((r) => setTimeout(r, 2000));
  job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
    headers: { "X-API-Key": "afk_your_api_key_here" },
  }).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);

Input schema

Request parameters accepted by the Flux 2 Pro endpoint. Model-specific options are nested under the params object shown below.

Parameter Type Required Default Allowed / range Description
prompt string required Text description of what to generate.
model string required "flux-2-pro" "flux-2-pro" The model identifier for this endpoint.
fluxParams.resolution string optional "2MP" "0.5MP", "1MP", "2MP", "4MP" Resolution
fluxParams.image_prompt string (URL) optional Reference image (URL)
fluxParams.image_prompt_strength number optional 0.5 min 0, max 1, step 0.05 How closely to follow the reference image (0–1).
fluxParams.output_format string optional "jpg" "jpg", "png", "webp" Output format
fluxParams.output_quality number optional 90 min 0, max 100, step 1 Output quality
fluxParams.prompt_upsampling boolean optional false Let the model rewrite your prompt for better quality.
fluxParams.seed number optional step 1 Reuse a number to reproduce the same result.

Frequently Asked Questions

Common questions about the Flux 2 Pro API.

Is Flux 2 Pro free?

No. On Apiframe it is a paid production model priced from 6 credits ($0.06) per image at 1MP up to 14 credits ($0.14) at 4MP, scaling with image size. The open-weight Dev variant is the free, local option.

How is it different from the other Flux 2 models?

Pro is the everyday production workhorse. Flex offers more control and typography quality at a higher price, Dev is the open-weight model for local use, and Klein is the fastest, lightest variant.

How many reference images can it use?

Up to 10 at once, for consistent characters, products, and styles.

Can it edit images, not just generate them?

Yes. It handles both text-to-image generation and image editing at up to 4MP in a single model.

Can you run it locally?

Not Pro itself, but the open-weight Dev and Klein variants are built for local and on-device use.

Where can you access it?

Through Apiframe, as well as the BFL API and major hosting partners.

Still have questions?

Start building with the Flux 2 Pro API

Get your API key and integrate Flux 2 Pro in minutes — Pay-as-you-go.

Free credits to start
One API for every model
Webhooks, SDKs & idempotency
No provider account required

Questions? Join our Discord or contact sales.