bfl-api

Integrate BFL FLUX image generation APIs with polling, webhooks, and error handling.

Updated Sep 1, 2026
One-click install
npx skills add https://github.com/zamansepeti43/c-rak-agent --skill bfl-api-zamansepeti43
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bfl-api
Source: https://github.com/zamansepeti43/c-rak-agent/tree/main/video-engine/.agents/skills/bfl-api
Command: npx skills add https://github.com/zamansepeti43/c-rak-agent --skill bfl-api-zamansepeti43

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, aiohttp, flask, redis, express, axios, and includes references (resource) components.

What problem does it solve? Integrating the BFL FLUX API requires handling asynchronous polling, expiring result URLs, rate limits, and webhook security, which is error-prone without a structured reference. ## Core Features & Use Cases - Endpoint & Model Reference: Covers all FLUX.2 and FLUX.1 endpoints with pricing, regional base URLs, and request parameters for text-to-image and multi-reference image editing. - Async Patterns: Provides polling strategies with exponential backoff, webhook integration with HMAC-SHA256 signature verification, and rate limit handling for 24 concurrent requests. - Ready-Made Clients: Includes production-oriented cURL, Python, and TypeScript clients with retry logic, semaphore-based concurrency, and typed error classes. - Use Case: A developer building an image generation feature can copy the Python client, set BFL_API_KEY, and submit a FLUX.2 [pro] request with automatic polling and download before the result URL expires in 10 minutes. ## Quick Start Ask the agent to generate an image with the BFL FLUX API using the flux-2-pro model and handle polling until the result is ready.

Frequently Asked Questions about bfl-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with the BFL FLUX API?

Send a POST request to a model endpoint like /v1/flux-2-pro with your prompt and the x-key header containing your API key. The response returns a polling_url, which you GET repeatedly until the status is Ready, then download the result image.

Should I use polling or webhooks for the BFL API?

Use polling for scripts, CLI tools, and simple integrations since it works everywhere. Use webhooks for production apps and high-volume workloads where you need immediate event-driven notification without repeated polling requests.

How many reference images does FLUX.2 support for image editing?

FLUX.2 [klein] supports up to 4 input images, while FLUX.2 [pro], [max], and [flex] support up to 8 via input_image through input_image_8 parameters. Reference images by number in your prompt, and pass URLs directly since the API fetches them automatically.

Why did my BFL API result URL stop working?

Result URLs from the BFL API expire 10 minutes after generation completes. Download the image immediately when the polling status becomes Ready instead of storing or caching the URL for later use.

What are the BFL API rate limits and how do I handle 429 errors?

Standard endpoints allow 24 concurrent in-flight requests. On HTTP 429, read the Retry-After header and retry with exponential backoff, or use a semaphore to cap client-side concurrency below the limit.

Which BFL endpoint should I use for GDPR compliance?

Use the EU regional endpoint https://api.eu.bfl.ai for GDPR compliance and EU data residency. The global endpoint https://api.bfl.ai is the default with automatic failover, and https://api.us.bfl.ai serves US data residency needs.