The FLUX Pro API from Black Forest Labs gives developers direct access to one of the most capable text-to-image models available today. Whether you are building a SaaS product, automating creative workflows, or just experimenting with AI-generated visuals, understanding the pricing tiers and seeing real code examples will help you get started faster.
What Is the FLUX Pro API?
The FLUX Pro API is a REST endpoint hosted by Black Forest Labs (BFL) that lets you generate images from text prompts programmatically. Unlike the free FLUX Schnell and open-weight FLUX Dev models, FLUX Pro is a closed, commercially licensed model optimized for photorealism, prompt adherence, and output resolution up to 4 megapixels. You send a JSON payload with your prompt and parameters, and the API returns a high-fidelity image within seconds. The FLUX 1.1 Pro model remains the most popular variant for production use cases thanks to its balance of speed and quality.
FLUX Pro API Pricing Breakdown
BFL prices the API per megapixel of output. Here is the current rate card:
| Model Tier | Text-to-Image | Image Editing | Max Resolution |
|---|---|---|---|
| FLUX Pro | From $0.05/MP | From $0.07/MP | 4 MP |
| FLUX Dev | From $0.025/MP | N/A | 2 MP |
| FLUX Schnell | Free (rate-limited) | N/A | 1 MP |
A standard 1024×1024 image (about 1 MP) on FLUX Pro costs roughly $0.05. A 2048×2048 image (4 MP) costs around $0.20. If you need batch image generation, costs scale linearly with volume, though BFL offers volume discounts for accounts generating over 100,000 images per month.
For teams that want to integrate image generation into their own apps without managing infrastructure, platforms like Wireflow’s creative tools provide a managed layer on top of the raw API with built-in workflow orchestration.

How FLUX Pro Compares to Other Image APIs
Several providers offer text-to-image APIs, but they differ significantly in pricing, quality, and flexibility. Here is a quick comparison for developers evaluating their options, drawing on our AI image generation comparison:
| Provider | Price per Image (1 MP) | Max Resolution | Latency | Commercial License |
|---|---|---|---|---|
| FLUX Pro (BFL) | ~$0.05 | 4 MP | 3-8s | Yes |
| DALL-E 3 (OpenAI) | $0.04-0.08 | 1024×1792 | 5-15s | Yes |
| Stable Diffusion 3 (Stability) | $0.03-0.065 | 1024×1024 | 2-6s | Yes |
| Midjourney (via API) | Subscription-based | 1024×1024 | 10-60s | Yes (paid plans) |
FLUX Pro stands out for its high resolution ceiling and strong photorealism. If prompt adherence matters for your use case, you can explore the FLUX AI image generator to test different prompt styles before committing to API integration. For a broader look at how different content generation APIs stack up, including video and audio, our comparison guide covers the full landscape.
Getting Started: Authentication and Setup
Before writing any code, you need a BFL API key. Sign up at the BFL website, navigate to your dashboard, and generate an API key. Store it securely as an environment variable. If you are new to the FLUX model family, our overview of FLUX prompts is a good companion read while you set up.
export BFL_API_KEY="your-api-key-here"
The base URL for all FLUX Pro endpoints is:
https://api.bfl.ai/v1
Authentication uses a Bearer token in the Authorization header. All requests and responses use JSON. Rate limits depend on your plan tier, but free accounts are typically capped at 10 requests per minute. For real-time generation use cases, the FLUX Realtime model uses the same authentication flow with lower latency.
Code Examples: Generating Images with FLUX Pro
Python Example
Here is a minimal Python script that sends a prompt to FLUX Pro and prints the resulting image URL. For prompt ideas, browse the FLUX prompt library for tested examples across different styles.
import requests
import os
API_KEY = os.environ["BFL_API_KEY"]
url = "https://api.bfl.ai/v1/flux-pro-1.1"
payload = {
"prompt": "A serene mountain lake at golden hour, photorealistic, 8k detail",
"width": 1024,
"height": 1024,
"steps": 28,
"guidance": 3.5
}
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
result = response.json()
image_url = result["images"][0]["url"]
print(f"Image generated: {image_url}")
else:
print(f"Error: {response.status_code} - {response.text}")
For more complete examples including error handling and async polling, see our guide on calling FLUX from code with cURL and Python.

The cURL approach below works the same way, and you can adapt either snippet for headless AI workflow platforms that chain multiple models together.
cURL Example
curl -X POST https://api.bfl.ai/v1/flux-pro-1.1 \
-H "Authorization: Bearer $BFL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Professional product photo of wireless headphones on marble surface, studio lighting",
"width": 1536,
"height": 1024,
"steps": 28,
"guidance": 3.5
}'
Node.js Example
The same request works with node-fetch. This pattern integrates well with no-code AI workflow builders when you want to wrap API calls in a reusable action.
const fetch = require('node-fetch');
async function generateImage(prompt) {
const response = await fetch('https://api.bfl.ai/v1/flux-pro-1.1', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.BFL_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt,
width: 1024,
height: 1024,
steps: 28,
guidance: 3.5
})
});
const data = await response.json();
return data.images[0].url;
}
generateImage('Cinematic portrait with dramatic rim lighting')
.then(url => console.log('Generated:', url))
.catch(err => console.error(err));
Best Practices for Production Use
When moving from prototyping to production, keep these points in mind:
- Cache aggressively. If the same prompt is used repeatedly, store the result rather than re-generating. This cuts costs significantly for template-based workflows.
- Use async polling for large batches. The synchronous endpoint works for one-off generations, but for batches of 10 or more images, use the async task endpoint and poll for completion. See our REST API pipeline guide for architectural patterns.
- Set resolution intentionally. Generating at 4 MP when you only need a 512px thumbnail is a waste. Match output resolution to your display context.
-
Handle rate limits gracefully. Implement exponential backoff with jitter. The API returns
429 Too Many Requestswith aRetry-Afterheader.
For teams looking to browse available AI tools and categories across the broader generative AI ecosystem, directories can help you discover complementary services for audio, video, and text generation alongside your image pipeline.

Error Handling and Common Pitfalls
The API returns standard HTTP status codes, similar to those used by other AI orchestration APIs. Here are the ones you will encounter most:
-
400 Bad Request: Invalid prompt (too long, contains blocked content) or unsupported parameter values. Check the
error.messagefield in the response body. - 401 Unauthorized: Missing or expired API key. Regenerate your key in the BFL dashboard.
-
429 Too Many Requests: Rate limit exceeded. Wait for the duration specified in the
Retry-Afterheader. - 500 Internal Server Error: Temporary server issue. Retry after a few seconds with backoff.
A common pitfall is setting steps too high. Values above 50 rarely improve quality but increase latency and cost. The sweet spot for most prompts is 25-30 steps with a guidance scale between 3.0 and 4.0. You can test different parameter combinations in the FLUX prompt generator before hardcoding them in your application.
Frequently Asked Questions
How much does the FLUX Pro API cost per image? At 1 megapixel (1024×1024), a single FLUX Pro image costs approximately $0.05. The price scales linearly with resolution: a 4 MP image costs around $0.20. BFL offers volume discounts for high-throughput accounts.
Is there a free tier for the FLUX Pro API? FLUX Pro itself does not have a free tier, but the FLUX Schnell model is free with rate limits. You can use Schnell for prototyping and switch to Pro for production quality. Try the free AI image generator to see what Schnell can do before upgrading.
What programming languages are supported? The API is language-agnostic since it uses standard REST/JSON. Any language with HTTP capabilities works. Python, JavaScript, and cURL are the most common choices. Our FLUX code tutorial covers all three in depth.
Can I use FLUX Pro images commercially? Yes. FLUX Pro includes a commercial license. Generated images can be used in products, marketing materials, and client work without additional licensing fees. Many teams use it to produce realistic AI photos for e-commerce and advertising.
How fast is the FLUX Pro API? Typical latency ranges from 3 to 8 seconds for a 1 MP image, depending on server load and the number of inference steps. Higher resolutions and step counts increase generation time. For near-instant previews, see the FLUX Krea integration which offers real-time generation.
What is the maximum image resolution? FLUX Pro supports output up to 4 megapixels. This is significantly higher than most competitors, which cap at 1-2 MP. For large-format prints or high-DPI displays, this is a meaningful advantage.
How does FLUX Pro compare to FLUX Dev? FLUX Dev is cheaper ($0.025/MP vs $0.05/MP) and open-weight, but it maxes out at 2 MP and produces slightly less detailed outputs. Pro is the better choice when photorealism and resolution matter. For a deeper comparison of model tiers, see our guide to what FLUX is.
Conclusion
The FLUX Pro API offers a strong combination of image quality, resolution flexibility, and straightforward pricing for developers building image generation into their products. The code examples above should get you from zero to your first generated image in minutes. For teams that need workflow automation, batch processing, and a visual canvas on top of the raw API, Wireflow provides an end-to-end platform that connects FLUX Pro with other AI models in a single pipeline.
