# 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.

Source: https://flux1.ai/api/docs

* **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`](https://flux1.ai/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](https://flux1.ai/api/docs/for-agents) for the `AGENTS.md` snippet.

- [llms.txt](https://flux1.ai/api/docs/llms.txt): Index of every page with a one-line summary and its Markdown URL. Small; load it first.
- [llms-full.txt](https://flux1.ai/api/docs/llms-full.txt): Every page in one file, live model tables and prices included. For long-context models.
- [{page}.md](https://flux1.ai/api/docs/quick-start.md): Any docs URL plus .md returns that page as Markdown. The Copy Markdown button copies the same text.

```text
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.

- [Nano Banana 2.1](https://flux1.ai/api/docs/image-models/nano-banana-2-1): Google's newest Nano Banana: 1K / 2K / 4K output, up to 14 references and extreme aspect ratios. Example cost: 12 credits / image.
- [Nano Banana 2](https://flux1.ai/api/docs/image-models/nano-banana-2): Multi-subject consistency and 1K / 2K / 4K output with extreme aspect ratios. Example cost: 10 credits / image.
- [Nano Banana Pro](https://flux1.ai/api/docs/image-models/nano-banana-pro): Native 2K with 4K output, precise typography and composition control. Example cost: 14 credits / image.
- [Nano Banana](https://flux1.ai/api/docs/image-models/nano-banana): Fast text-to-image and image editing with strong character consistency. Example cost: 6 credits / image.
- [Nano Banana 2 Lite](https://flux1.ai/api/docs/image-models/nano-banana-2-lite): Budget Nano Banana 2 at 1K. Example cost: 6 credits / image.
- [GPT Image 2.5](https://flux1.ai/api/docs/image-models/gpt-image-2-5): OpenAI's latest image model: sharp text and precise edits at 1K, 2K or 4K, in Flare or Sunburst. Example cost: 12 credits / image.
- [GPT Image 2](https://flux1.ai/api/docs/image-models/gpt-image-2): OpenAI text-to-image and image editing with reliable prompt following. Example cost: 12 credits / image.
- [Seedream 5.0 Lite](https://flux1.ai/api/docs/image-models/seedream-5): Text-to-image and reference-image editing with 2K, 3K and 4K output. Example cost: 6 credits / image.

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

## Video models

- [Seedance 2.0](https://flux1.ai/api/docs/video-models/seedance-2): Text-to-video, first-frame animation and first/last-frame transitions, with optional generated audio. Example cost: 360 credits / video (5s).
- [Seedance 2.0 Fast](https://flux1.ai/api/docs/video-models/seedance-2-fast): Text-to-video, first-frame animation and first/last-frame transitions, with optional generated audio. Example cost: 280 credits / video (5s).
- [Seedance 2.0 Mini](https://flux1.ai/api/docs/video-models/seedance-2-mini): Text-to-video, first-frame animation and first/last-frame transitions, with optional generated audio. Example cost: 175 credits / video (5s).
- [Veo 3.1](https://flux1.ai/api/docs/video-models/veo-3-1): Veo 3.1 Fast and Quality with native audio, text, frame and Fast reference-image generation. Example cost: 200 credits / video (8s).

## 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](https://flux1.ai/api/docs/generations#idempotency) for retries. Persisted image tasks also appear in [My Images](https://flux1.ai/my-image).

> The API is included with every paid plan and credit pack. Create keys at [Settings → API Keys](https://flux1.ai/manage/api-keys) and follow every request under [Settings → API Logs](https://flux1.ai/manage/api-logs). Free and gifted credits alone do not unlock it.

## Where to start

  - [Quick start](https://flux1.ai/api/docs/quick-start) — Submit your first generation with cURL, Node.js or Python.

  - [Generations](https://flux1.ai/api/docs/generations) — Create, poll and list generations. Request fields and statuses.

  - [Models and prices](https://flux1.ai/api/docs/models) — The live catalog with credit prices and option lists.

  - [For agents](https://flux1.ai/api/docs/for-agents) — llms.txt, Markdown for every page, and rules for your AGENTS.md.
