Flux API

Use the Flux API via RunAPI with a model skill, unified auth, and pay-as-you-go pricing.

runapi.ai
curl -X POST https://runapi.ai/api/v1/flux/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "flux-dev",
  "prompt": "Generate a 4K product hero image of a matte-black water bottle on a beige stone surface, soft side light."
}'
import { FluxClient } from "@runapi.ai/flux";

const client = new FluxClient();
const result = await client.textToImage.run({
    model: "flux-dev",
    prompt: "Generate a 4K product hero image of a matte-black water bottle on a beige stone surface, soft side light.",
});
require "runapi/flux"

client = RunApi::Flux::Client.new
result = client.text_to_image.run(
    model: "flux-dev",
    prompt: "Generate a 4K product hero image of a matte-black water bottle on a beige stone surface, soft side light."
)
npx skills add runapi-ai/flux -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 v1
OVERVIEW

About Flux

Flux spans high-quality production, efficient iteration, and low-latency generation across three models, with single-image editing available on Dev and Pro.

Provider
Black Forest Labs
Modality
Image

Available Versions

Variant Billing Pricing
flux-2-klein call $0.01 View →
flux-dev call $0.06 View →
flux-pro call $0.04 View →
PRICING

Flux Pricing

Endpoint Resolution Duration Price
text_to_image — — $0.01 / image

Prices shown for flux-2-klein. Other variants retain their own endpoint pricing.

Agent integration

Run Flux From an Agent

HOW IT WORKS

Get Started with Flux

  1. Create an API key

    Sign up and generate an API key from the dashboard.

  2. Pick a version

    Choose the version that best matches your quality and cost requirements.

  3. Send a request

    Submit your prompt and parameters to the model's documented endpoint.

  4. Get your result

    Poll the task or set a webhook, then download the completed output.

CONTEXT

About Flux on RunAPI

The Flux API exposes a image model from Black Forest Labs, accessible through RunAPI with a single API key and per-call billing. Developers call Flux the same way they call any other model in the RunAPI catalog — set the model parameter, submit a request, and receive structured JSON. The model skill packages docs, typed schemas, pricing notes, and setup steps so your coding agent has the right context before you write integration code. Billing is unified across all providers, failed generations are never charged, and results are retrievable by task ID.

Provider
Black Forest Labs
See all →
Modality
Image
Browse models →

Why Use Flux Through RunAPI

One auth, every provider

A single RunAPI API key unlocks the whole model catalog across all providers. No separate accounts to create, no API keys to rotate per integration, and no credential management overhead. Add a new model to your app by changing one parameter.

Unified pricing & billing

Per-call pricing in USD, billed monthly into a single invoice. No subscription tiers, no minimum spend, and failed generations are never charged. The pricing page and check_pricing API show exact costs before you commit to a model.

Schema-first SDK

Typed schemas, parameter constraints, and setup notes are packaged in the model skill so your implementation starts from the right contract. The skill loads into Claude Code, Codex, Gemini CLI, Cursor, and VS Code — your agent knows the correct request shape before you write a line of code.

Flux Questions

Which Flux model should I use?

Use Flux Dev for efficient iteration, Flux Pro for the strongest prompt adherence and visual detail, and Flux 2 Klein for rapid, low-latency workflows.

Can Flux edit an existing image?

Yes. With Flux Dev or Flux Pro, the remix-image endpoint edits exactly one publicly accessible source image from text instructions and returns the same task response shape as text-to-image.

Which variant should I start with?

Pick the cheapest variant that meets your quality bar. Most teams start on the fast variant and graduate to pro for production.

Is there a free tier?

Creating an account and API key is free. API calls use prepaid, pay-as-you-go billing; add funds before making requests.

Do you stream results?

Where streaming is available, RunAPI streams end-to-end.

How are failures billed?

Failed generations are not charged.

SIMILAR MODELS

Similar Image Models

Start generating with Flux