Skip to main content
Our API endpoints enable media creation with BFL models. It follows an asynchronous design, where you first make a request for a generation and then query for the result of your request.

API Endpoints

api.bfl.ai - Recommended for most use cases
  • Routes requests across all available clusters globally
  • Automatic failover between clusters for enhanced uptime
  • Intelligent load distribution prevents bottlenecks during high traffic
Always use the polling_url returned in responses when using this endpoint
🇪🇺 api.eu.bfl.ai - European Multi-cluster
  • Multi-cluster routing limited to EU regions
  • GDPR compliant
🇺🇸 api.us.bfl.ai - US Multi-cluster
  • Multi-cluster routing limited to US regions
For enhanced reliability and performance, we recommend using the global endpoint api.bfl.ai or regional endpoints api.eu.bfl.ai/api.us.bfl.ai for inference tasks.

Available Endpoints

We currently support the following endpoints for image generation:
  1. /flux-2-max
  2. /flux-2-pro-preview — our latest FLUX.2 [pro]
  3. /flux-2-pro — a fixed snapshot of FLUX.2 [pro] for workflows that require reproducibility
  4. /flux-2-flex
  5. /flux-2-klein-4b
  6. /flux-2-klein-9b-preview — our latest FLUX.2 [klein] 9B with KV caching
  7. /flux-2-klein-9b — a fixed snapshot of FLUX.2 [klein] 9B for reproducibility
  8. /flux-kontext-max
  9. /flux-kontext-pro
  10. /flux-pro-1.1-ultra
  11. /flux-pro-1.1
  12. /flux-pro
  13. /flux-dev
Preview endpoints (flux-2-pro-preview, flux-2-klein-9b-preview) reflect our latest advances and are the best place to start. Choose non-preview endpoints when you need a pinned model for reproducibility. See Preview Endpoints for details.

Create Your First Image

Submit Generation Request

To submit an image generation task, create a request. This example uses flux-2-pro-preview, our latest and most capable model:
A successful response will be a JSON object containing the request’s id and a polling_url that should be used to retrieve the result.
Important: When using the global endpoint (api.bfl.ai) or regional endpoints (api.eu.bfl.ai, api.us.bfl.ai), you must use the polling_url returned in the response for checking request status.

Poll for Results

To retrieve the result, poll the endpoint using the polling_url:
A successful response will be a JSON object containing the result, where result['sample'] is a signed URL for retrieval.
Our signed URLs are only valid for 10 minutes. Please retrieve your result within this timeframe.
Image Delivery: The result.sample URLs are served from region-specific delivery endpoints under delivery.*.bfl.ai. Region identifiers are subject to change as we add or remove clusters, so if you need to whitelist these hosts, whitelist the wildcard delivery.*.bfl.ai rather than individual regions. These URLs are not meant to be served directly to users — we recommend downloading the image and re-serving it from your own infrastructure. We do not enable CORS on delivery URLs.
See our reference documentation for a full list of options and our inference repo.

Limits

Rate Limits: Sending requests to our API is limited to 24 active tasks. If you exceed your limit, you’ll receive a status code 429 and must wait until one of your previous tasks has finished.
Rate Limits: Additionally, due to capacity issues, for flux-kontext-max, requests to our API are limited to 6 active tasks.
Credits: If you run out of credits (status code 402), visit https://api.bfl.ai, sign in and click “Add” to buy additional credits. See also Credits & Billing.
If you require higher volumes, please contact us at flux@blackforestlabs.ai.