# BFL FLUX API

Explains the BFL FLUX API, covering endpoints, async polling, errors and webhooks.

- Repository: https://github.com/calesthio/OpenMontage (74341 stars)
- Category: Media
- License: AGPL-3.0
- Last updated: 2026-10-28
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add calesthio/OpenMontage --skill bfl-api -g -a claude-code -y`
Codex: `npx skills add calesthio/OpenMontage --skill bfl-api -g -a codex -y`
Cursor: `npx skills add calesthio/OpenMontage --skill bfl-api -g -a cursor -y`
Gemini CLI: `npx skills add calesthio/OpenMontage --skill bfl-api -g -a gemini-cli -y`

## Description

BFL FLUX API integration guide covering endpoints, async polling patterns, rate limiting, error handling, webhooks, and regional endpoints with Python and TypeScript code examples.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# BFL API Integration Guide

Use this skill when integrating BFL FLUX APIs into applications for image generation, editing, and processing.

## First: Check API Key

**Before generating images, verify your API key is set:**

```bash
echo $BFL_API_KEY
```

If empty or you see "Not authenticated" errors, see [API Key Setup](#api-key-setup) below.

## Important: Image URLs Expire in 10 Minutes

Result URLs from the API are temporary. Download images immediately after generation completes - do not store or cache the URLs themselves.

## When to Use

- Setting up BFL API client
- Implementing async polling patterns
- Handling rate limits and errors
- Configuring webhooks for production
- Selecting regional endpoints
- Building production-ready integrations

## Quick Reference

### Base Endpoints

| Region | Endpoint                | Use Case                    |
| ------ | ----------------------- | --------------------------- |
| Global | `https://api.bfl.ai`    | Default, automatic failover |
| EU     | `https://api.eu.bfl.ai` | GDPR compliance             |
| US     | `https://api.us.bfl.ai` | US data residency           |

### Model Endpoints & Pricing

> **Credit pricing:** 1 credit = $0.01 USD. FLUX.2 uses megapixel-based pricing (cost scales with resolution).

#### FLUX.2 Models

The rest: https://github.com/calesthio/OpenMontage/blob/HEAD/.agents/skills/bfl-api/SKILL.md
