Flux1 AIDevelopers
Flux1 AI API docs

For agents

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.

Every page in these docs is also served as plain Markdown, with the live model tables, option lists and credit prices written out. Give your coding agent the Markdown, not the HTML: it is smaller, has no navigation chrome, and always matches what the rendered page shows.

Machine-readable docs

Fetch them yourself
curl https://flux1.ai/api/docs/llms.txt
curl https://flux1.ai/api/docs/llms-full.txt
curl https://flux1.ai/api/docs/image-models/nano-banana-2.md

All three are public: no API key, no cookies. They are built from the same source as the HTML pages, so the two never drift apart.

Paste this prompt

Start a session in Claude Code, Cursor, Codex or a chat assistant with this prompt, then ask your question. It sends the agent to the index first, so it opens only the pages it needs.

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.

On any docs page, Copy Markdown copies that page, and Open in hands its Markdown URL to ChatGPT, Claude or Cursor.

Add it to your project's agent rules

If the project calls the API, keep the essentials where your agent reads them on every task: AGENTS.md, CLAUDE.md, or a file in .cursor/rules/.

AGENTS.md
## Flux1 AI API

- Docs: https://flux1.ai/api/docs/llms.txt (Markdown index). Read the page for a model before calling it; do not guess field names.
- Base URL: https://flux1.ai/api/v1
- Auth: `Authorization: Bearer $FLUX1_API_KEY`. Server-side only; never ship the key to a browser or commit it.
- Generations are async: POST /v1/generations returns 202 and an id. Poll GET /v1/generations/{id} every 2-3 s until status is succeeded, failed or rejected.
- Send a unique Idempotency-Key on every POST; reuse it only to retry the same body.
- Models, options and credit prices: GET /v1/models. Never hard-code a price.
- Results expire 30 days after storage (`expires_at`); download outputs to your own storage.

What an agent should get right

TopicRuleRead
KeysRead FLUX1_API_KEY from the environment. There is no CORS on the API; calls from a browser fail by design.Authentication
Request shapeOne endpoint for every model. model plus that model's fields at the top level of the body.Generations
WaitingNo webhooks in v1. Poll every 2–3 seconds; stop on succeeded, failed or rejected.Generations
RetriesA lost response is retried with the same Idempotency-Key and body, never a new key.Safe retries
CostCredits are charged on submit and refunded on failure. Check credits_refunded, not the status alone.Credits
ErrorsBranch on error.code, not the message text. Back off on 429.Errors
Rate limits

Not available yet

There is no MCP server, OpenAPI file or official SDK for the API today. The Markdown above plus GET /v1/models cover what those would describe; the roadmap lists what comes next.