canonical: https://jentic.com/apis/blackforestlabs.ai/blackforestlabs

# Black Forest Labs FLUX API

The Black Forest Labs FLUX API generates and edits images with the FLUX.2, FLUX.1, and Kontext model families. It runs text-to-image generation, prompt-based image editing, inpainting, and outpainting, all as asynchronous tasks that you submit and then poll for a result. It also reports remaining credits and lists the fine-tuned models on an account.

## For AI agents

Generate images from text, edit images with FLUX Kontext, inpaint and outpaint, poll for asynchronous results, check credits, and list fine-tunes with the Black Forest Labs FLUX API.

## Scope

Does not host generated images long term, generate video, or manage billing. Use for FLUX image generation, editing, and result retrieval only.

## Capabilities

- Generate images from text prompts with FLUX models
- Edit existing images with FLUX Kontext models
- Inpaint a masked region and outpaint to expand an image
- Poll for asynchronous generation results
- Check the remaining API credits on an account
- List fine-tuned models and read their details

## Use cases

### AI agent image generation

An AI agent producing visual content can generate images from prompts and retrieve them once ready. Through Jentic the agent searches by intent and the API key never enters its prompt context, so a content assistant can call FLUX directly and hand back finished images.

Example prompt: Use Jentic to search 'generate an image with FLUX', call POST `/v1/flux-2-pro` with a prompt, then poll GET `/v1/get_result` until the image is ready.

### Prompt-based image editing

A creative tool edits an existing image from a natural-language instruction using the Kontext models. The agent submits the source image with the instruction and polls for the edited output, keeping the edit loop fully programmatic.

Example prompt: Submit an edit via POST `/v1/flux-kontext-pro` with a source image and instruction, then poll GET `/v1/get_result` for the edited image.

### Inpaint and outpaint

An image pipeline fills a masked region or extends the canvas beyond the original frame. The agent calls the fill or expand model and retrieves the result, automating retouching and canvas extension without a manual editor.

Example prompt: Fill a masked area via POST `/v1/flux-pro-1.0-fill`, or extend the canvas via POST `/v1/flux-pro-1.0-expand`, then retrieve the output with GET `/v1/get_result.`

### Credit and fine-tune management

An operations agent monitors an account's remaining credits and the fine-tuned models available to it. This keeps generation workflows from stalling on an empty balance and tracks which custom models are in use.

Example prompt: Call GET `/v1/credits` to check the remaining balance and GET `/v1/my_finetunes` to list the account's fine-tuned models.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/flux-2-pro` | Generate an image with FLUX.2 Pro |
| POST | `/v1/flux-kontext-pro` | Edit an image with FLUX Kontext Pro |
| POST | `/v1/flux-pro-1.0-fill` | Inpaint a masked region |
| POST | `/v1/flux-pro-1.0-expand` | Outpaint to expand an image |
| GET | `/v1/get_result` | Poll for a generation result |
| GET | `/v1/credits` | Check remaining credits |
| GET | `/v1/my_finetunes` | List fine-tuned models |
| POST | `/v1/delete_finetune` | Delete a fine-tune |

## Key resources

- **Generation Models** — FLUX.2, FLUX.1, and Kontext model endpoints for text-to-image and editing
- **Results** — Asynchronous task results retrieved by polling
- **Credits** — Remaining account credit balance
- **Fine-tunes** — Custom fine-tuned models on an account

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 62 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 73 / 100
  - Developer Experience & Jentic Compatibility: 62 / 100
  - AI-Readiness & Agent Experience: 48 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 64 / 100
- **View full report:** https://jentic.com/apis/blackforestlabs.ai/blackforestlabs/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Black Forest Labs FLUX API by hand means sending your x-key header to api.bfl.ai, submitting a generation task, and polling for the result yourself. Through Jentic you install once, import FLUX from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** FLUX addresses each model as its own operation and carries the prompt in the request body, so a rule bounds which operations your agent may call. You can allow only the generation and result-polling operations, so deleting a fine-tune is not included unless you add it.
- **Credential handling:** Your Black Forest Labs API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate an image' or 'edit an image', and Jentic returns the matching FLUX operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Stability AI** — Stability AI generates images with the Stable Diffusion model family
- **fal** — fal serves many image and video models, including FLUX, on one inference platform
- **Replicate** — Replicate hosts and runs open models with a consistent prediction API

## FAQ

### Is there a Black Forest Labs FLUX MCP server?

You don't need an MCP server to give your agent FLUX. Jentic connects it directly from the API Directory: import it, store your key once, and your agent calls the generation, edit, and result operations. That keeps your agent's context free of an extra server's tool definitions.

### What authentication does the Black Forest Labs FLUX API use?

It authenticates with an API key sent in the x-key header, per its OpenAPI spec. Through Jentic the key is stored encrypted by your own instance and injected at call time, so it never reaches the agent's context.

### Can I generate images asynchronously with the Black Forest Labs FLUX API?

Yes. Generation is asynchronous: POST `/v1/flux-2-pro` (or another FLUX model) submits a task, and GET `/v1/get_result` polls until the image is ready to download.

### What are the rate limits for the Black Forest Labs FLUX API?

The OpenAPI spec does not specify rate limits. Check the Black Forest Labs documentation at https://docs.bfl.ml for current limits and any active-task caps.

### How do I generate an image through Jentic?

Search Jentic for 'generate an image with FLUX', load the input schema, and execute POST `/v1/flux-2-pro`, then poll GET `/v1/get_result.` To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the Black Forest Labs FLUX API?

Yes. Write a rule that allows only the generation and result-polling operations, so the agent can create and fetch images and nothing else, and every call it makes is logged. Deleting a fine-tune stays out unless you add that operation.
