Image Generation with Text Prompts
Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.
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
Primary Global Endpoint
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
- Does not support finetuning and finetuned inference
- Important: Always use the
polling_url
returned in responses when using this endpoint
Regional Endpoints
api.eu.bfl.ai
- European Multi-cluster
- Multi-cluster routing limited to EU regions
- GDPR compliant
- Does not support finetuning and finetuned inference
api.us.bfl.ai
- US Multi-cluster
- Multi-cluster routing limited to US regions
- Does not support finetuning and finetuned inference
Legacy Regional Endpoints
api.eu1.bfl.ai
- EU Single-cluster
- Single cluster, no automatic failover
- Required for finetuning and finetuned inference operations in EU region
api.us1.bfl.ai
- US Single-cluster
- Single cluster, no automatic failover
- Required for finetuning and finetuned inference operations in US region
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:
/flux-kontext-pro
/flux-kontext-max
/flux-pro-1.1-ultra
/flux-pro-1.1
/flux-pro
/flux-dev
Create Your First Image
Submit Generation Request
To submit an image generation task with FLUX 1.1 [pro], create a request:
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 delivery endpoints (delivery-eu1.bfl.ai
, delivery-us1.bfl.ai
) and 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
, the requests to our API is 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 managing your account.
If you require higher volumes, please contact us at flux@blackforestlabs.ai