Flux 2 Flex icon

Flux 2 Flex API

Black Forest Labs' developer-controlled member of the Flux 2 family (Nov 2025), built for typography and fine detail, with manual control over the quality, speed, and cost of every generation.

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

model: "flux-2-flex"
Flux 2 Flex kombucha bottle label mockup reading 'WILD GINGER' with 'Organic, 330ml' beneath in crisp small text

What's special about Flux 2 Flex

Direct parameter control

Unlike the other Flux 2 models, which auto-tune their settings, Flex exposes the number of inference steps and the guidance scale so you decide the exact speed-versus-quality balance.

A built-in quality dial

Lower step counts (around 6 to 10) generate fast drafts, while higher counts (up to 50) produce sharper detail and cleaner text, all from one endpoint.

Superior typography

It is tuned to render legible text and complex layouts reliably, which makes it the strongest Flux 2 variant for text-heavy work.

Fine detail preservation

It holds up better on small textures and intricate elements, especially at higher resolutions where fine detail has room to resolve.

Multi-reference support

It can take up to 10 reference images (14MP total input) to keep characters, products, and styles consistent.

Generation and editing in one model

It both creates images from text and edits existing ones at up to 4MP.

Made with Flux 2 Flex

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

Flux 2 Flex clean infographic titled 'How Solar Panels Work' with four labeled steps in a flat modern style

A clean infographic titled 'How Solar Panels Work' with four labeled steps, flat modern style.

Flux 2 Flex mobile app dashboard mockup with a balance card reading '$2,480.00', three menu tabs, and legible button labels

A mobile app dashboard with a balance card reading '$2,480.00', three menu tabs, and legible button labels.

Flux 2 Flex minimalist bakery logo for 'FLOUR & STONE' with clean serif lettering in a warm neutral palette

A minimalist logo for a bakery called 'FLOUR & STONE', clean serif lettering, warm neutral palette.

Flux 2 Flex concert poster reading 'NIGHT MARKET LIVE' with the date 'AUG 14' and venue in a bold typographic layout

A concert poster reading 'NIGHT MARKET LIVE' with the date 'AUG 14' and venue, bold typographic layout.

Flux 2 Flex kombucha bottle label mockup reading 'WILD GINGER' with 'Organic, 330ml' beneath in crisp small text

A kombucha bottle label reading 'WILD GINGER' with 'Organic, 330ml' beneath, crisp small text.

Flux 2 Flex square social promo reading '24-HOUR FLASH SALE, UP TO 50% OFF' with clean type on a bright gradient

A square promo reading '24-HOUR FLASH SALE, UP TO 50% OFF' with clean type and a bright gradient.

Overview

Endpoint
POST /v2/images/generate
Model ID
flux-2-flex
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 Flex. 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-flex",
        "fluxParams": {
            "resolution": "2MP",
            "image_prompt": "https://example.com/input.jpg",
            "image_prompt_strength": 0.5,
            "steps": 28
        }
    }'
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-flex",
        "fluxParams": {
            "resolution": "2MP",
            "image_prompt": "https://example.com/input.jpg",
            "image_prompt_strength": 0.5,
            "steps": 28
        }
    },
)
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-flex",
    "fluxParams": {
      "resolution": "2MP",
      "image_prompt": "https://example.com/input.jpg",
      "image_prompt_strength": 0.5,
      "steps": 28
    }
  }),
});
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 Flex 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-flex" "flux-2-flex" 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.steps number optional 28 min 1, max 50, step 1 Steps
fluxParams.guidance number optional 3 min 1.5, max 10, step 0.1 How strictly to follow the prompt.
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.go_fast boolean optional false Go fast
fluxParams.seed number optional step 1 Reuse a number to reproduce the same result.

Frequently Asked Questions

Common questions about the Flux 2 Flex API.

How is it different from Flux 2 Pro?

Flex exposes the inference steps and guidance scale for manual control, while Pro auto-tunes them for hands-off production. Flex sits at a higher price point and leans toward typography and detail work.

How much does it cost?

On Apiframe it ranges from 10 credits ($0.10) at 0.5MP to 40 credits ($0.40) at 4MP.

What do the steps and guidance settings actually do?

Steps act as a quality dial that trades speed for detail, and guidance scale controls how literally the model follows your prompt.

How many reference images can it use?

Up to 10 at once, totaling 14MP of input.

Can it edit images, not just generate them?

Yes, it supports both text-to-image generation and editing at up to 4MP.

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 Flex API

Get your API key and integrate Flux 2 Flex 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.