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
llms.txt/api/docs/llms.txtIndex of every page with a one-line summary and its Markdown URL. Small; load it first.llms-full.txt/api/docs/llms-full.txtEvery page in one file, live model tables and prices included. For long-context models.{page}.md/api/docs/quick-start.mdAny docs URL plus .md returns that page as Markdown. The Copy Markdown button copies the same text.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.mdAll 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.
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/.
## 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
| Topic | Rule | Read |
|---|---|---|
| Keys | Read FLUX1_API_KEY from the environment. There is no CORS on the API; calls from a browser fail by design. | Authentication |
| Request shape | One endpoint for every model. model plus that model's fields at the top level of the body. | Generations |
| Waiting | No webhooks in v1. Poll every 2–3 seconds; stop on succeeded, failed or rejected. | Generations |
| Retries | A lost response is retried with the same Idempotency-Key and body, never a new key. | Safe retries |
| Cost | Credits are charged on submit and refunded on failure. Check credits_refunded, not the status alone. | Credits |
| Errors | Branch 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.