VARIANT · Black Forest Labs / Flux 2

flux-2-flex-text-to-image API

Black Forest Labs / Flux 2

Use flux-2-flex-text-to-image from the Flux 2 family via RunAPI. Per-call pricing, no subscription, and failed generations are never charged.

Operational · image · Commercial OK
runapi.ai
curl -X POST https://runapi.ai/api/v1/flux_2/text_to_image \
  -H "Authorization: Bearer $RUNAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "flux-2-flex-text-to-image",
  "prompt": "Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, 8K detail."
}'
import { Flux2Client } from "@runapi.ai/flux-2";

const client = new Flux2Client();
const result = await client.textToImage.run({
    model: "flux-2-flex-text-to-image",
    prompt: "Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, 8K detail.",
});
<?php

require __DIR__ . "/vendor/autoload.php";

use RunApi\Flux2\Flux2Client;

$client = new Flux2Client();
$result = $client->textToImage->run([
        'model' => 'flux-2-flex-text-to-image',
        'prompt' => 'Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, 8K detail.',
]);
require "runapi/flux_2"

client = RunApi::Flux2::Client.new
result = client.text_to_image.run(
    model: "flux-2-flex-text-to-image",
    prompt: "Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, 8K detail."
)
npx skills add runapi-ai/flux-2 -g
# Claude Code
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp

# Codex
codex plugin install runapi-mcp@agents

# Cursor / Windsurf / VS Code
npx @runapi.ai/mcp init cursor
@runapi.ai/flux-2 v1
Switch variant
OVERVIEW

flux-2-flex-text-to-image targets the sweet spot of quality and cost within the Flux 2 family. It shares the same API key, request shape, and async task lifecycle as every other RunAPI model — switch to this variant by changing one model ID parameter. Install the Flux 2 skill to load docs, typed schemas, pricing notes, and setup steps into your coding workspace. Billing is metered per completed request in USD with no subscription or minimum spend, and failed generations are never charged.

  • Pay-per-call pricing in USD with no subscription
  • Failed generations are never charged
  • Streaming when supported by the model
  • Schema-validated parameters and tool calls
  • Switch variant by changing one model ID parameter
  • Unified billing across all models and providers
PRICING

Pricing

Failed generations are not charged
Text to image
$0.14-$0.24 / image
Output resolution: 1k $0.14
Output resolution: 2k $0.24
SPEC SHEET

Technical details

Model ID flux-2-flex-text-to-image
Provider Black Forest Labs
Modality image
Task type asynchronous
Billing unit call
API endpoint /api/v1/flux_2/text_to_image
Commercial license Yes — included via API
Catalog status Operational
SKILLS

Model skill — flux-2-flex-text-to-image

Install the skill once, then use the variant ID from this page while building.

# Install the model skill for app development workflows
npx skills add runapi-ai/flux-2 -g
Installs docs, schemas, pricing context, and setup notes into your developer workspace.
Or use this setup request in your coding tool:
Install the Flux 2 skill for this app:

1. Add runapi-ai/flux-2 with the skills installer.
2. Load SKILL.md in this workspace.
3. Use its docs, schemas, pricing notes, and setup steps when adding model features.
4. Confirm the install path when done.
HOW IT WORKS

Use flux-2-flex-text-to-image with a model skill

01

Install

Install the model skill for the %{model} line. The skill loads docs, typed schemas, pricing notes, and setup steps into your coding workspace so your agent has the right context.

02

Configure

Set the model field to the full model ID shown on this page and configure your RunAPI API key as an environment variable. The same key works across all models and providers.

03

Call

Use the skill instructions while adding prompt, input, and callback handling to your application. RunAPI routes the request to the provider, manages the async lifecycle, and returns structured JSON.

04

Receive

Read the task response by polling the task ID, streaming when supported, or handling the webhook callback at your configured URL. Generated outputs are stored and retrievable by task ID.

DIFFERENCES

What's different about flux-2-flex-text-to-image

VS FLUX-2-FLEX-REMIX-IMAGE

Adjustable steps + guidance; up to 10 ref images; best typography

Flex control + reference image input

VS FLUX-2-PRO-REMIX-IMAGE

Adjustable steps + guidance; up to 10 ref images; best typography

Pro quality with input image as style/content seed

VS FLUX-2-PRO-TEXT-TO-IMAGE

Adjustable steps + guidance; up to 10 ref images; best typography

Zero-config flagship; automatic prompt enhancement

USE CASES

Best for

Product photography

Auto-generate lifestyle product photos for e-commerce catalogs that lack studio photography.

Game & concept art

Rapidly concept environments and characters before committing to final art.

Editorial illustration

Generate unique cover art and illustrations for blog posts and articles at scale.

FAQ

Frequently asked questions about flux-2-flex-text-to-image

Is the model ID stable across versions?

Yes. RunAPI keeps the model ID stable and handles compatible version refreshes without changing your request shape. You do not need to update your code when the provider releases a new compatible version.

What's the rate limit on this variant?

Per-key rate limits scale with your usage tier. The pricing page shows current limits. If you need higher throughput, contact support to discuss tier upgrades.

Can I switch variants later?

Yes. Variant is a parameter in the request. Switch by changing the model ID — no code changes, no re-authentication, no separate billing setup. All variants share the same API key and request shape.

Does it stream?

Where streaming is available, RunAPI streams end-to-end. LLM models support token-level streaming. Media models use async task polling or webhook callbacks for result delivery.

Where do I report quality issues?

Open an issue on the public GitHub repo or email support at [email protected]. Include the task ID and model ID so the team can investigate the specific generation.

Do I need a separate provider account?

No. Your RunAPI API key is enough to access this variant and every other model in the catalog. You do not need accounts with the underlying provider.

START NOW

Start building with Flux 2.