Black Forest Labs API

Give your agents access to Black Forest Labs API. Bring your own Black Forest Labs key, or skip the signup and pay per call from your Composio balance with Composio Instant.

Black Forest Labs logoBlack Forest Labs
Instant

Black Forest Labs provides hosted FLUX models for generating and editing images and videos. It offers fast, flexible media creation with asynchronous processing and fine-tuning support.

14 Tools
COMPOSIO INSTANT

What is Composio Instant?

Composio Instant lets your agent use paid APIs like Black Forest Labs without a separate account or API key for each one. New accounts start with $2 of free credit.

No Black Forest Labs account or key

Your agent calls Black Forest Labs through Composio, so there is nothing to sign up for, store, or rotate.

Pay per call, at cost

From $0.041 per image (768²) up to $0.607 (~4K²); varies with size., paid from your Composio balance with zero markup.

Works in any agent

Claude, ChatGPT, Cursor, and other MCP clients, or your own code with the Composio SDK.

Works with your apps

Use Black Forest Labs with Gmail, Slack, Google Sheets, and 1,700+ other apps you connect.

AI ASSISTANTS

Connect the Black Forest Labs API to your AI assistant

Use Black Forest Labs from the AI assistant you already work in. Connect Composio once, then paste the prompt.

  1. 1

    Open the Connectors menu

    Use the button to open Claude's Add connector dialog with Composio filled in. Or click + in the message box, then Connectors, Add connector and Add custom connector.
    Add Composio to Claude
  2. 2

    Add the Composio MCP server

    Name it Composio, paste the MCP server URL and click Add.
    https://connect.composio.dev/mcp
  3. 3

    Authorize in your browser

    A browser window opens. Sign in to Composio to approve the connection.
  4. 4

    Paste the prompt

    Start a new chat and paste the prompt. Claude runs the call on Composio Instant.
  1. 1

    Install the Composio plugin

    Open Composio's plugin page in ChatGPT and click Install. Sign in to ChatGPT first if it asks.
    Install in ChatGPT
  2. 2

    Authorize in your browser

    Connect the plugin, then sign in to Composio to approve the connection.
  3. 3

    Turn on Composio in your chat

    In a new chat, click +, then More, and select Composio.
  4. 4

    Paste the prompt

    Paste the prompt into that chat. ChatGPT runs the call on Composio Instant.
  1. 1

    Install the Composio plugin

    Open Composio in the Cursor marketplace, click Install Composio Plugin for Cursor and approve the connection in your browser.
    Install in Cursor
  2. 2

    Paste the prompt

    Open the Agent chat and paste the prompt. Cursor runs the call on Composio Instant.
  1. 1

    Add the Composio plugin

    Open Composio's listing on x.ai and click Add to Grok Bot. When Grok Bot opens the plugin, click Add.
    Add to Grok Bot
  2. 2

    Authenticate

    Go to Installed, open Composio and click Authenticate. Sign in to Composio and click Authorize.
  3. 3

    Paste the prompt

    Paste the prompt into your bot's chat. Grok Bot runs the call on Composio Instant.
  1. 1

    Paste the setup prompt

    Copy this into your Hermes chat. Hermes adds the Composio MCP server for you.
    Set up Composio from composio.dev/hermes
  2. 2

    Authorize in your browser

    A browser window opens. Sign in to Composio to approve the connection.
  3. 3

    Paste the prompt

    Start a new chat and paste the prompt. Hermes runs the call on Composio Instant.
ClaudeNew chat

Paste this prompt

Use Black Forest Labs through Composio Instant to create a square editorial illustration of a red bicycle leaning against a brick wall on a quiet city street in soft morning light. Return the generated image.

What success looks like

BFL_GENERATE_OR_EDIT_IMAGE

Your assistant runs Black Forest Labs and replies with the generated image of a red bicycle on a quiet city street.

Runs on Composio Instant
SDK

Use the Black Forest Labs API in your code

Call Black Forest Labs from your own agent with the Composio SDK. Four steps and one tool call.

  1. 1

    Set up Composio

    Turn on Instant Toolkits in your project settings and check your prepaid balance in Billing. Then set your API key.
    export COMPOSIO_API_KEY="your_composio_api_key"
  2. 2

    Install the SDK

    The Python SDK needs Python 3.11 through 3.15.
    pip install composio
  3. 3

    Run the call

    Create a session that keeps Instant to this toolkit and reports the charge, then run the tool on the Instant account.
    BFL_GENERATE_OR_EDIT_IMAGE
  4. 4

    Read the response

    When the call runs on Instant, the response includes its charge: the amount as an exact USD decimal string, the currency and charged_by.
agent.py
from composio import Composio

composio = Composio()

session = composio.sessions.create(
    user_id="user_123",
    toolkits=["bfl"],
    instant={
        "toolkits": {"enable": ["bfl"]},
        "return_instant_charge": True,
    },
)

result = session.execute(
    "BFL_GENERATE_OR_EDIT_IMAGE",
    arguments={
        "prompt": "Create a square editorial illustration of a red bicycle leaning against a brick wall on a quiet city street in soft morning light.",
        "aspect_ratio": "1:1",
    },
    account="instant_account",
)
print(result)
print("Instant charge:", result.instant_charge)
TOOLS

Available Black Forest Labs API tools

3 Black Forest Labs tools run on Instant, priced per call with no Black Forest Labs key. Tools marked Your key need your own Black Forest Labs account.

ActionTool slugWhat it doesAvailability
Generate ImageBFL_GENERATE_OR_EDIT_IMAGEGenerate an image from text or edit a reference image.
InstantFrom $0.041 per image (768²) up to $0.607 (~4K²); varies with size.
Generate VideoBFL_GENERATE_VIDEOCreate a video from text, keyframes, a source video, or a draft.
InstantStarts at $0.06 per output second for HD drafts; full-render price varies by mode and resolution. Eligible fixed-duration requests have a published price of at most $2.
Get Task StatusBFL_GET_GENERATION_RESULTCheck the status of an image or video generation task.
Instant$0 per request
Edit VideoBFL_EDIT_VIDEOEdit a source video with a text prompt.Your key
Erase Image ObjectBFL_ERASE_IMAGE_OBJECTRemove a masked object from an image.Your key
Outpaint ImageBFL_OUTPAINT_IMAGEExpand an image onto a larger canvas.Your key
Upscale VideoBFL_UPSCALE_VIDEOIncrease the resolution of a video's first 20 seconds.Your key
Virtual Try-OnBFL_VIRTUAL_TRY_ONCreate a virtual try-on using person and garment images.Your key

Instant prices are Black Forest Labs's list prices with 0% markup, paid from your Composio balance and updated every hour. Instant calls also count toward your plan's tool calls. See all plans on the pricing page.

USE CASES

Black Forest Labs API use cases and example prompts

Copy a prompt into your agent. Each one uses Black Forest Labs with apps you connect through Composio.

  • Create launch campaign visuals

    Use Black Forest Labs to generate a campaign image for Acme's new analytics dashboard, with a clean interface-inspired look and space for a headline. Save the image in my Launch Campaign folder in Google Drive, then post a preview in Slack's #product-launch channel.

    Apps used: Black Forest Labs, Google Drive, Slack

  • Make a product teaser video

    Use Black Forest Labs to create a short teaser video from this outline: show a team reviewing a dashboard, highlight a sudden change in a key metric, and end on the Acme product name. Save the video in my Product Launch folder in Google Drive and share it in Slack's #marketing channel.

    Apps used: Black Forest Labs, Google Drive, Slack

  • Build a visual concept page

    Use Black Forest Labs to generate an image concept for Acme's upcoming customer conference, with a bold abstract stage backdrop in our brand colors. Add the image and a short description to a new page called Customer Conference Visual Concept in my Marketing Workspace in Notion.

    Apps used: Black Forest Labs, Notion

  • Prepare visuals for a sales proposal

    Use Black Forest Labs to edit the product image in my Acme Proposal folder in Google Drive so it shows the dashboard on a laptop in a modern office. Save the edited image in that folder, then draft a Gmail message to the Acme sales team with the image link and a note that it is ready to review.

    Apps used: Black Forest Labs, Google Drive, Gmail

TROUBLESHOOTING

Black Forest Labs API troubleshooting

Still stuck? The Instant tools docs cover limits, charges and session settings.

Start with Black Forest Labs.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Black Forest Labs tool your agent needs.Free to start.

Start building