What problem does it solve?
Provides clear, production-ready guidance and code patterns to integrate with the BFL FLUX API so teams can reliably submit image generation and editing requests, handle asynchronous results, and avoid common pitfalls like expired URLs and rate limits.
Core Features & Use Cases
- Endpoint & Region Selection: Guidance on choosing global, EU, or US endpoints for residency and failover.
- Authentication & Key Management: Steps to validate and securely load BFL_API_KEY for CLI, local, and server environments.
- Async Patterns: Polling strategies, exponential backoff, adaptive polling, and webhook integration with signature verification.
- Rate Limiting & Retries: Client-side semaphores, queueing, retry/backoff policies, and headers to monitor limits.
- Error Handling & Resilience: Classification of retryable vs non-retryable errors, circuit breaker pattern, and logging best practices.
- Use Case: Integrate into server applications or agents to generate or edit images, process batches, and persist results before URL expiration.
Quick Start
Submit a generation request to the appropriate flux endpoint with your BFL_API_KEY, wait for the polling_url to return status Ready, and immediately download the result URL before it expires.