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

BASEhttps://api.fluxapi.org/v1

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/json

Keep 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

POST/v1/images/generations

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

  • modelflux-pro-1-1 or flux-dev. Required.
  • prompt — text description of the image. Required.
  • size — e.g. 1024x1024, 1536x1024.
  • n — number of images. response_formaturl or b64_json.

Models

GET/v1/models
Model IDName
flux-pro-1-1FLUX1.1 Pro
flux-devFLUX.1 Dev

Errors

Conventional HTTP status codes are used, with an OpenAI-style error body: { "error": { "message", "type", "code" } }.

CodeMeaning
400Malformed request
401Invalid or missing API key
402Insufficient credits — top up your balance
429Rate limit exceeded
500 / 503Upstream 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.