Flux1 AIDevelopers
Flux1 AI API docs

Flux1 AI API

Build with Nano Banana, GPT Image, Seedream, Seedance and Veo. Generate images and video, edit with references, and track every request through one API.

  • Base URL https://flux1.ai/api/v1
  • Authentication Authorization: Bearer fx1_live_…
  • Format JSON request bodies, JSON responses
  • Docs for agents /api/docs/llms.txt — every page as Markdown

Build with an AI agent

Using Claude Code, Cursor or Codex? Hand it the Markdown docs instead of this page. Paste the prompt below, or see For agents for the AGENTS.md snippet.

prompt.txt
Read https://flux1.ai/api/docs/llms.txt first. It lists every Flux1 AI API docs page as Markdown. Open the pages you need before writing code, and answer from those docs only; do not guess field names or prices.

Key facts: base URL https://flux1.ai/api/v1. Auth header "Authorization: Bearer $FLUX1_API_KEY", server-side only. POST /v1/generations returns 202 with an id; poll GET /v1/generations/{id} every 2-3 seconds until the status is succeeded, failed or rejected. Send a unique Idempotency-Key with every POST.

Image models

Choose a model for its complete parameter reference, credit prices and ready-to-copy cURL, Node.js and Python examples.

Model previews are AI-created concept artwork inspired by each model name, not sample outputs from the listed models.

Video models

How it works

Every generation is asynchronous. POST /v1/generations validates the request, charges the credits for it, hands the job to the model provider and returns 202 Accepted with a generation id. You then GET /v1/generations/{id} until status leaves queued. There are no webhooks in v1; polling every 2–3 seconds is the expected pattern.

Credits are shared with the web app: the same balance and per-model prices. Pre-debit rejections cost nothing; check credits_refunded to confirm a refund. Uncertain submissions may require review. Use Idempotency-Key for retries. Persisted image tasks also appear in My Images.

The API is included with every paid plan and credit pack. Create keys at Settings → API Keys and follow every request under Settings → API Logs. Free and gifted credits alone do not unlock it.

Where to start