Documentation Index
Fetch the complete documentation index at: https://docs.bfl.ml/llms.txt
Use this file to discover all available pages before exploring further.
API Endpoints Overview
Primary Global Endpoint
api.bfl.ai - Primary Endpoint
- Routes requests across all available clusters globally
- Provides automatic failover between clusters for enhanced uptime
- Intelligent load distribution prevents bottlenecks during high traffic periods
- Important: Always use the
polling_urlreturned in responses when using this endpoint - Suitable for: Standard inference
Regional Endpoints
api.eu.bfl.ai - European Multi-cluster Endpoint
- Multi-cluster routing limited to EU regions
- GDPR compliant
- Provides the same uptime and load balancing benefits within EU regions
api.us.bfl.ai - US Multi-cluster Endpoint
- Multi-cluster routing limited to US regions
- Provides the same uptime and load balancing benefits within US regions
Key Benefits of New Endpoints
Enhanced Reliability
Reduced downtime through automatic cluster failover
Better Performance
Intelligent traffic distribution prevents overload during peak usage
Seamless Experience
Load balancing happens transparently on our end
Polling URL Usage
When using the primary 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 initial request response.
Webhook Users: If you’re using webhooks to receive results, no changes are needed. The
polling_url requirement only applies when implementing async polling behavior to check request status.Example Implementation
Content Delivery and Storage Guidelines
Delivery URLs
Generated images are served from region-specific delivery URLs underdelivery.*.bfl.ai. The region identifier is subject to change as we add or remove clusters, so do not rely on any specific hostname.
Important Delivery Considerations
Network Access: If your infrastructure uses firewalls or network restrictions, whitelist the wildcard
delivery.*.bfl.ai (or all of *.bfl.ai) to allow downloading generated images. Whitelisting individual regional hostnames is not recommended — region identifiers can change as clusters are added or removed.Recommended Image Handling
Download and Re-serve Pattern:Migration Checklist
Update API Endpoints
- Replace legacy endpoints with appropriate new endpoints based on your needs
- Use
api.bfl.aifor global load balancing - Use
api.eu.bfl.aiorapi.us.bfl.aifor regional preferences
Implement Polling URL Handling
- Ensure your code extracts and uses the
polling_urlfrom API responses - Update polling logic to use the provided polling URL instead of hardcoded endpoints
Best Practices
Error Handling
Rate Limiting
- Maximum 24 concurrent requests for most endpoints
- Maximum 6 concurrent requests for
flux-kontext-max - Implement exponential backoff for 429 responses
Content Management
- Download images immediately upon generation completion
- Implement proper error handling for expired URLs
- Consider implementing a queue system for high-volume applications
- Use appropriate storage solutions (CDN, cloud storage) for serving images to users

