FLUX API Documentation
Buy credits, generate a key, and call FLUX through a simple endpoint. If you've used the OpenAI API before, you already know this one.
fluxapi.org is an independent proxy and reseller for FLUX. Endpoints below point at our proxy; responses originate from FLUX models.
Introduction
The FLUX API exposes a REST interface modeled on the OpenAI specification. You authenticate with a bearer token and receive standard JSON responses, so the official OpenAI SDKs and most HTTP clients work with minimal changes.
Base URL
Authentication
The API uses bearer token authentication. Create a key from your dashboard after topping up credits, then pass it on every request:
# HTTP headers
Authorization: Bearer sk-flux-your-key
Content-Type: application/jsonKeep keys secret. Treat API keys like passwords — never embed them in client-side code or commit them to a repository. Rotate or revoke a leaked key instantly from your dashboard.
Quickstart
Python
from openai import OpenAI
client = OpenAI(api_key="sk-flux-your-key", base_url="https://api.fluxapi.org/v1")
img = client.images.generate(
model="flux-pro-1-1",
prompt="a red panda coding at night, cinematic lighting",
size="1024x1024",
n=1,
)
print(img.data[0].url)cURL
curl https://api.fluxapi.org/v1/images/generations \
-H "Authorization: Bearer sk-flux-your-key" \
-H "Content-Type: application/json" \
-d '{"model": "flux-pro-1-1", "prompt": "a serene mountain lake", "size": "1024x1024"}'Generate images
Generates one or more images from a text prompt. Returns an OpenAI-style response with hosted URLs.
{ "created": 1716400000, "data": [ { "url": "https://cdn.fluxapi.org/img/abc.png" } ] }Parameters
model—flux-pro-1-1orflux-dev. Required.prompt— text description of the image. Required.size— e.g.1024x1024,1536x1024.n— number of images.response_format—urlorb64_json.
Models
| Model ID | Name |
|---|---|
| flux-pro-1-1 | FLUX1.1 Pro |
| flux-dev | FLUX.1 Dev |
Errors
Conventional HTTP status codes are used, with an OpenAI-style error body: { "error": { "message", "type", "code" } }.
| Code | Meaning |
|---|---|
| 400 | Malformed request |
| 401 | Invalid or missing API key |
| 402 | Insufficient credits — top up your balance |
| 429 | Rate limit exceeded |
| 500 / 503 | Upstream or proxy error — retry with backoff |
Rate limits
Rate limits scale with your plan and balance. When you exceed a limit you'll receive a 429 with a Retry-After header — back off and retry. Need a custom limit? Contact us.
Ready to build? Get your API key and make your first call in minutes.