Technical Implementation & Usage
Last updated: June 26, 2025
How can I track the amount of images generated?
Usage tracking is done via the BFL API. For each of our offered models, we have a dedicated metering endpoint that you have to call from your inference code after an image has been generated.
Below you find an example code snippet that shows how to use the endpoint.
You will receive your login information to the BFL-API once the license is signed.
You can customize the code as needed, as long as you make sure that the reporting is accurate.
Based on your usage, we will invoice you at the end of each month if your number of generated images within that month exceeds 100,000.
import requests
# MODEL_SLUG is either: `flux-1-dev`, `flux-1-kontext-dev` or `flux-tools`
url = "https://api.bfl.ai/v1/licenses/models/<MODEL_SLUG>/usage"
headers = {
"x-key": "<YOUR_KEY>",
"Content-Type": "application/json"
}
payload = {
"number_of_generations": <POSITIVE_INTEGER>
}
response = requests.post(url, headers=headers, json=payload)
print(f"Status code: {response.status_code}")
print(f"Response: {response.text}")What is the latency of the usage tracking endpoint?
The usage tracking endpoint yields results in 10-50 milliseconds. Bulk reporting is also possible. A reference implementation can be found in our public Github repository.
Can I use derivatives like LoRA, ControlNet, or IP-Adapters?
Yes, you can create and use derivatives for your internal operations and service integration. However, you may only distribute Derivatives by making the applicable Licensed FLUX [dev] Model available via your Customer Application. Separately distributing derivatives to third parties via an API or any other means is not allowed.
Are the TensorRT weights that are optimized for the NVIDIA Blackwell architecture for FLUX.1 [dev] and FLUX.1 Kontext [dev] available for self-serve licensing as well?
No, the optimized TensorRT weights are not yet available for self-serve licensing. We will make them available for self-serve licensing soon. If you’d like to use them, please contact us at https://bfl.ai/contact.