Send a server-side request
Create a BFL account, add API credit and create a key in the official dashboard. Store it as a server secret. The browser studio uses its own provider configuration; you do not need a developer key to use our online image generator.
Step 1: create a small text-to-image task
This shell example submits one billable request to your own BFL account when you run it. Set BFL_API_KEY privately first. It uses 1K output so you can inspect a draft before increasing resolution.
curl --fail-with-body --request POST \
'https://api.bfl.ai/v1/flux-3-image-klein' \
--header "x-key: $BFL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"prompt": "An amber glass vase on a white shelf, a single olive branch, side light through linen curtains, quiet editorial photograph.",
"aspect_ratio": "1:1",
"resolution": "1k",
"output_format": "png"
}'Step 2: add references when needed
Use the same endpoint with an images array for edits. It accepts up to ten reference URLs or base64 inputs. Refer to them by upload order in the prompt. Explicitly select the output tier instead of relying on the first reference's default size.
Keep the task and poll for the result
- Save the response. Keep its
idandpolling_urlwith your own request record. - Poll that task. Validate the returned URL against the documented BFL service before attaching credentials. Use a bounded polling interval and timeout rather than a tight loop.
- Handle a terminal status. A
Readyresult can be downloaded. Record failures or moderation outcomes; do not treat an HTTP success alone as image delivery. - Recover before retrying. A lost connection can leave a submitted task running. Reconcile the saved task before creating a second charge.
This is the same operational distinction our studio makes between a submitted request and a delivered file. Your own integration needs its own storage, spending limits and recovery behavior. See BFL's integration guidelines.
API pricing and studio credits are separate
| Output tier | BFL price per image | Suggested use |
|---|---|---|
| 1K | US$0.009 | First composition draft |
| 2K | US$0.014 | Review a larger output |
| 4K | US$0.036 | Final high-resolution output |
Publisher rates checked October 17, 2026. BFL lists the same Klein rate for text-to-image and editing at a given tier. Check current official API pricing before budgeting. Account terms and applicable taxes can affect your total.
These are direct provider rates, not this website's credit prices. Flux3Klein subscriptions and one-time credits cover studio service; see studio pricing and credit quotes. We do not provide a public developer API or exchange studio credits for BFL balance.
Common integration errors
Authorization or balance problems
Confirm that the server has the intended BFL account key and enough provider credit. Do not print the key in logs or expose it in a support screenshot.
Invalid request fields
Check names, tier values, aspect ratios and reference inputs against the endpoint schema. A studio label such as “image editing” is not an extra API field. Keep a minimal text-only request as your baseline.
A slow or uncertain task
Inspect the existing polling response and provider status before resubmitting. Add an application budget and concurrency limit; a free browser allowance does not apply to your own direct API calls.