Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问clear审计提醒

bfl-apiBFL API 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

7,119

周安装

288

GitHub Stars

54

下载量

2,235
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bfl-api(BFL API 文档)
来源仓库:https://github.com/black-forest-labs/skills
仓库路径:skills/bfl-api
安装命令:
npx skills add https://github.com/black-forest-labs/skills --skill bfl-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/black-forest-labs/skills --skill bfl-api

简介

该技能用于辅助 API 设计、接口文档生成和集成说明,适合梳理 endpoint、检查字段命名或联调支持。

  • 适用于需要生成 OpenAPI 草稿、整理错误码或验证服务集成的场景。
  • 使用时需结合真实业务语义、鉴权方式和分页规则,避免凭空补字段。
  • 建议从现有代码或接口样例中提取事实,确保输出符合实际实现。
  • bfl-api 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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:

echo $BFL_API_KEY

If empty or you see "Not authenticated" errors, see 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

RegionEndpointUse Case
Globalhttps://api.bfl.aiDefault, automatic failover
EUhttps://api.eu.bfl.aiGDPR compliance
UShttps://api.us.bfl.aiUS 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

ModelPath1st MP+MP1MP T2I1MP I2IBest For
FLUX.2 [klein] 4B/v1/flux-2-klein-4b1.4c0.1c$0.014$0.015Real-time, high volume
FLUX.2 [klein] 9B/v1/flux-2-klein-9b1.5c0.2c$0.015$0.017Balanced quality/speed
FLUX.2 [pro]/v1/flux-2-pro3c1.5c$0.03$0.045Production, fast turnaround
FLUX.2 [max]/v1/flux-2-max7c3c$0.07$0.10Maximum quality
FLUX.2 [flex]/v1/flux-2-flex5c5c$0.05$0.10Typography, adjustable controls
FLUX.2 [dev]---FreeFreeLocal development (non-commercial)
Pricing formula: (firstMP + (outputMP-1) * mpPrice) + (inputMP * mpPrice) in cents

FLUX.1 Models

ModelPathPrice/ImageBest For
FLUX.1 Kontext [pro]/v1/flux-kontext$0.04Image editing with context
FLUX.1 Kontext [max]/v1/flux-kontext-max$0.08Max quality editing
FLUX1.1 [pro]/v1/flux-pro-1.1$0.04Standard T2I, fast & reliable
FLUX1.1 [pro] Ultra/v1/flux-pro-1.1-ultra$0.06Ultra high-resolution
FLUX1.1 [pro] Raw/v1/flux-pro-1.1-raw$0.06Candid photography feel
FLUX.1 Fill [pro]/v1/flux-pro-1.0-fill$0.05Inpainting
Tip: All FLUX.2 models support image editing via the input_image parameter - no separate editing endpoint needed. Use bfl.ai/pricing calculator for exact costs at different resolutions.

Image Input for Editing

Preferred: Use URLs directly - simpler and more convenient than base64.

Single image editing:

curl -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Change the background to a sunset",
    "input_image": "https://example.com/photo.jpg"
  }'

Multi-reference editing:

curl -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "The person from image 1 in the environment from image 2",
    "input_image": "https://example.com/person.jpg",
    "input_image_2": "https://example.com/background.jpg"
  }'

The API fetches URLs automatically. Both URL and base64 work, but URLs are recommended when available.

Multi-Reference I2I

FLUX.2 models support multiple input images for combining elements, style transfer, and character consistency:

ModelMax References
FLUX.2 [klein]4 images
FLUX.2 [pro/max/flex]8 images

Parameters: input_image, input_image_2, input_image_3,... input_image_8

Prompt pattern: Reference images by number in your prompt:

  • "The subject from image 1 in the environment from image 2"
  • "Apply the style of image 2 to the scene in image 1"
  • "The person from image 1 wearing the outfit from image 2, in the pose from image 3"
For detailed multi-reference patterns (character consistency, style transfer, pose guidance), see flux-best-practices/rules/multi-reference-editing.md

Rate Limits

TierConcurrent Requests
Standard (most endpoints)24

Polling vs Webhooks

ApproachUse When
PollingScripts, CLI tools, local development, single requests, simple integrations
WebhooksProduction apps, high volume, server-to-server, when you need immediate notification

Start with polling - it's simpler and works everywhere. Switch to webhooks when you need to scale or want event-driven architecture.

Key Behaviors

  • Polling: Response includes polling_url for async results
  • URL Expiration: Result URLs expire after 10 minutes
  • Webhook Support: Configure webhook_url for production workloads

API Key Setup

Required: The BFL_API_KEY environment variable must be set before using the API.

Quick Check

echo $BFL_API_KEY

If Not Set

  1. Get a key: Go to https://dashboard.bfl.ai/get-started → Click "Create Key" → Select organization
  2. Save to .env (recommended for persistence): echo 'BFL_API_KEY=bfl_your_key_here' >>.env echo '.env' >>.gitignore # Don't commit secrets

See references/api-key-setup.md for detailed setup instructions.

Authentication

x-key: YOUR_API_KEY

Basic Request Flow

1. POST request to model endpoint
   └─> Response: { "polling_url": "..." }

2. GET polling_url (repeat until complete)
   └─> Response: { "status": "Pending" | "Ready" | "Error", ... }

3. When Ready, download result URL
   └─> URL expires in 10 minutes - download immediately

Related

  • Prompting best practices (T2I, I2I, typography, colors): see the flux-best-practices skill
  • Multi-reference patterns (character consistency, style transfer, pose guidance): see flux-best-practices/rules/multi-reference-editing.md

References

Code Examples

Note: cURL examples are preferred by default as they work universally without requiring Python or Node.js. Use language-specific clients when building production applications.

Quick Start Example

1. Submit Generation Request

curl -s -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A serene mountain landscape at sunset", "width": 1024, "height": 1024}'

Response:

{ "id": "abc123", "polling_url": "https://api.bfl.ai/v1/get_result?id=abc123" }

2. Poll for Result

curl -s "POLLING_URL" -H "x-key: $BFL_API_KEY"

Response when ready:

{ "status": "Ready", "result": { "sample": "https://...", "seed": 1234 } }

3. Download Image

curl -s -o output.png "IMAGE_URL"
Tip: Result URLs expire in 10 minutes. Download immediately after status becomes Ready.

4. Multi-Reference Example

Combine elements from multiple images:

curl -s -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "The cat from image 1 sitting in the cozy room from image 2",
    "input_image": "https://example.com/cat.jpg",
    "input_image_2": "https://example.com/room.jpg",
    "width": 1024,
    "height": 1024
  }'

Reference images by number in your prompt. See Multi-Reference I2I for limits and patterns.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.49%
按下载量换算614

OpenCode

26.19%
按下载量换算585

Cursor

20.4%
按下载量换算456

Gemini CLI

12.42%
按下载量换算278

Antigravity

7.94%
按下载量换算177

Codex

3.95%
按下载量换算88

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills