Flux 2 flux-2-flex-text-to-image API
Same API key, same model skill workflow — switch variants by changing one model ID.
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.",
});
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
flux-2-flex-text-to-image targets the sweet spot of quality and cost within the Flux 2 family.
- Pay-per-call pricing in USD
- Failed generations not charged
- Streaming when supported by the model
- Schema-validated tool calls
Pricing
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 |
| Status | Operational |
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
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.
Use flux-2-flex-text-to-image with a model skill
Install
Install the model skill for this model line.
Configure
Set the model field to the full model ID shown on this page.
Call
Use the skill instructions while adding prompt, input, and callback handling to your app.
Receive
Read the task response, webhook callback, or cached output URL from RunAPI.
What's different about flux-2-flex-text-to-image
Adjustable steps + guidance; up to 10 ref images; best typography
Flex control + reference image input
Adjustable steps + guidance; up to 10 ref images; best typography
Pro quality with input image as style/content seed
Adjustable steps + guidance; up to 10 ref images; best typography
Zero-config flagship; automatic prompt enhancement
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.
Frequently asked questions about flux-2-flex-text-to-image
Is the model ID stable across versions?
RunAPI keeps the model ID stable and handles compatible version refreshes without changing your request shape.
What's the rate limit on this variant?
Per-key rate limits scale with usage tier. See pricing page for current limits.
Can I switch variants later?
Yes — variant is a flag. Switch by changing the model parameter.
Does it stream?
Where streaming is available, RunAPI streams end-to-end.
Where do I report quality issues?
Open an issue on the public GitHub repo or email support.
Other variants of Flux 2
Alternatives from other models
GPT Image 2