# Flux1 AI API > REST API for AI image and video generation (Nano Banana, GPT Image, Seedream, Seedance, Veo), billed in the same credits as the Flux1 AI web app. - Base URL: https://flux1.ai/api/v1 - Auth: `Authorization: Bearer $FLUX1_API_KEY` (keys start with `fx1_live_`; call from a server, never a browser) - Flow: `POST /v1/generations` returns `202` with an id; poll `GET /v1/generations/{id}` every 2-3 seconds until `succeeded`, `failed` or `rejected` - Retries: send a unique `Idempotency-Key` per generation and reuse it only with the same body - Models, options and credit prices: `GET /v1/models`; never hard-code a price Every link below is the Markdown version of a docs page. ## Start here - [Flux1 AI API](https://flux1.ai/api/docs.md): Build with Nano Banana, GPT Image, Seedream, Seedance and Veo. Generate images and video, edit with references, and track every request through one API. - [Quick start](https://flux1.ai/api/docs/quick-start.md): Create a key, submit a generation, poll for the result. About ten lines in any language. - [Authentication](https://flux1.ai/api/docs/authentication.md): Send your key as a bearer token. Keys are shown once, stored hashed, and can be revoked at any time. - [For agents](https://flux1.ai/api/docs/for-agents.md): Point Claude Code, Cursor, Codex or any LLM at Markdown versions of these docs. One index file, one full-text file, and a Markdown URL for every page. ## Models - [Models](https://flux1.ai/api/docs/models.md): The live catalog with credit prices, allowed aspect ratios and reference-image limits. ## Image generation: Nano Banana - [Nano Banana 2.1](https://flux1.ai/api/docs/image-models/nano-banana-2-1.md): Google's newest Nano Banana model. Generate and edit images at 1K, 2K or 4K with up to 14 reference images. - [Nano Banana 2](https://flux1.ai/api/docs/image-models/nano-banana-2.md): Generate and edit at 1K, 2K or 4K with up to 14 reference images and a wide range of aspect ratios. - [Nano Banana Pro](https://flux1.ai/api/docs/image-models/nano-banana-pro.md): Generate and edit at 2K or 4K, with control over typography and composition. - [Nano Banana](https://flux1.ai/api/docs/image-models/nano-banana.md): Fast text-to-image and reference-image editing. Every accepted parameter, default and price in one place. - [Nano Banana 2 Lite](https://flux1.ai/api/docs/image-models/nano-banana-2-lite.md): Budget-friendly 1K image generation and editing with the same asynchronous API. ## Image generation: GPT Image - [GPT Image 2.5](https://flux1.ai/api/docs/image-models/gpt-image-2-5.md): OpenAI's latest image model. Sharp text and precise edits at 1K, 2K or 4K, with Flare for speed or Sunburst for precision. - [GPT Image 2](https://flux1.ai/api/docs/image-models/gpt-image-2.md): OpenAI text-to-image and image editing at 1K with up to 15 reference images and wide aspect ratios. ## Image generation: Seedream - [Seedream 5.0 Lite](https://flux1.ai/api/docs/image-models/seedream-5.md): Generate and edit images with Seedream 5.0 Lite. Choose 2K, 3K or 4K output, with up to 14 reference images. ## Video generation - [Seedance 2.0](https://flux1.ai/api/docs/video-models/seedance-2.md): Generate 4–15 second videos from text, a first frame, or first and last frames. - [Seedance 2.0 Fast](https://flux1.ai/api/docs/video-models/seedance-2-fast.md): Seedance Fast video generation with optional audio and per-second pricing. - [Seedance 2.0 Mini](https://flux1.ai/api/docs/video-models/seedance-2-mini.md): Lower-cost Seedance video generation with per-second pricing and optional audio. - [Veo 3.1](https://flux1.ai/api/docs/video-models/veo-3-1.md): Veo 3.1 Fast and Quality, with text, frames and Fast reference-image generation. ## API reference - [Generations](https://flux1.ai/api/docs/generations.md): Create a generation, poll it, list your history. One request shape for every model. - [Credits](https://flux1.ai/api/docs/credits.md): The API spends the same credit balance as the web app. Check it, and know when it moves. - [Errors](https://flux1.ai/api/docs/errors.md): Error codes, safe retries, and how to confirm credit refunds. - [Rate limits](https://flux1.ai/api/docs/rate-limits.md): Per-key request limits, a per-account cap on in-flight generations, and the headers that tell you where you stand. ## Platform - [Logs and retention](https://flux1.ai/api/docs/logs.md): Every request is logged with its input, output, credits and timing, and kept for a fixed period. - [Roadmap](https://flux1.ai/api/docs/roadmap.md): What is coming next to the API, in order. ## Optional - [All docs in one file](https://flux1.ai/api/docs/llms-full.txt): every page above, concatenated