Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.
Our API endpoints enable media creation with BFL models. It follows an asynchronous design, where you first make a request for a generation and then query for the result of your request.
Routes requests across all available clusters globally
Automatic failover between clusters for enhanced uptime
Intelligent load distribution prevents bottlenecks during high traffic
Always use the polling_url returned in responses when using this endpoint
Regional Endpoints
🇪🇺 api.eu.bfl.ai - European Multi-cluster
Multi-cluster routing limited to EU regions
GDPR compliant
🇺🇸 api.us.bfl.ai - US Multi-cluster
Multi-cluster routing limited to US regions
For enhanced reliability and performance, we recommend using the global endpoint api.bfl.ai or regional endpoints api.eu.bfl.ai/api.us.bfl.ai for inference tasks.
We currently support the following endpoints for image generation:
/flux-2-max
/flux-2-pro-preview — our latest FLUX.2 [pro]
/flux-2-pro — a fixed snapshot of FLUX.2 [pro] for workflows that require reproducibility
/flux-2-flex
/flux-2-klein-4b
/flux-2-klein-9b-preview — our latest FLUX.2 [klein] 9B with KV caching
/flux-2-klein-9b — a fixed snapshot of FLUX.2 [klein] 9B for reproducibility
/flux-kontext-max
/flux-kontext-pro
/flux-pro-1.1-ultra
/flux-pro-1.1
/flux-pro
/flux-dev
Preview endpoints (flux-2-pro-preview, flux-2-klein-9b-preview) reflect our latest advances and are the best place to start. Choose non-preview endpoints when you need a pinned model for reproducibility. See Preview Endpoints for details.
To submit an image generation task, create a request. This example uses flux-2-pro-preview, our latest and most capable model:
# Install curl and jq, then run:# Make sure to set your API key: export BFL_API_KEY="your_key_here"request=$(curl -X 'POST' \ 'https://api.bfl.ai/v1/flux-2-pro-preview' \ -H 'accept: application/json' \ -H "x-key: ${BFL_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "prompt": "A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.", "width": 1440, "height": 2048}')echo $requestrequest_id=$(jq -r .id <<< $request)polling_url=$(jq -r .polling_url <<< $request)echo "Request ID: ${request_id}"echo "Polling URL: ${polling_url}"
# Install requests: pip install requestsimport osimport requestsrequest = requests.post( 'https://api.bfl.ai/v1/flux-2-pro-preview', headers={ 'accept': 'application/json', 'x-key': os.environ.get("BFL_API_KEY"), 'Content-Type': 'application/json', }, json={ 'prompt': 'A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.', 'width': 1440, 'height': 2048 },).json()print(request)request_id = request["id"]polling_url = request["polling_url"]print(f"Request ID: {request_id}")print(f"Polling URL: {polling_url}")
A successful response will be a JSON object containing the request’s id and a polling_url that should be used to retrieve the result.
Important: When using the global endpoint (api.bfl.ai) or regional endpoints (api.eu.bfl.ai, api.us.bfl.ai), you must use the polling_url returned in the response for checking request status.
To retrieve the result, poll the endpoint using the polling_url:
# This assumes that the request_id and polling_url variables are set from the previous stepwhile truedo sleep 0.5 result=$(curl -s -X 'GET' \ "${polling_url}" \ -H 'accept: application/json' \ -H "x-key: ${BFL_API_KEY}") status=$(jq -r .status <<< $result) echo "Status: $status" if [ "$status" == "Ready" ] then echo "Result: $(jq -r .result.sample <<< $result)" break elif [ "$status" == "Error" ] || [ "$status" == "Failed" ] then echo "Generation failed: $result" break fidone
# This assumes request_id and polling_url are set from the previous stepimport timeimport osimport requestswhile True: time.sleep(0.5) result = requests.get( polling_url, headers={ 'accept': 'application/json', 'x-key': os.environ.get("BFL_API_KEY"), }, ).json() status = result["status"] print(f"Status: {status}") if status == "Ready": print(f"Result: {result['result']['sample']}") break elif status in ["Error", "Failed"]: print(f"Generation failed: {result}") break
A successful response will be a JSON object containing the result, where result['sample'] is a signed URL for retrieval.
Our signed URLs are only valid for 10 minutes. Please retrieve your result within this timeframe.
Image Delivery: The result.sample URLs are served from region-specific delivery endpoints under delivery.*.bfl.ai. Region identifiers are subject to change as we add or remove clusters, so if you need to whitelist these hosts, whitelist the wildcard delivery.*.bfl.ai rather than individual regions. These URLs are not meant to be served directly to users — we recommend downloading the image and re-serving it from your own infrastructure. We do not enable CORS on delivery URLs.
Rate Limits: Sending requests to our API is limited to 24 active tasks. If you exceed your limit, you’ll receive a status code 429 and must wait until one of your previous tasks has finished.
Rate Limits: Additionally, due to capacity issues, for flux-kontext-max, requests to our API are limited to 6 active tasks.
Credits: If you run out of credits (status code 402), visit https://api.bfl.ai, sign in and click “Add” to buy additional credits. See also Credits & Billing.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Black Forest Labs","colors":{"primary":"#486A58","light":"#F6F1E7","dark":"#13251D"},"logo":{"light":"https://mintcdn.com/bfl/OQ5B17YmedKOM4zs/logo/logo_light.png?fit=max\u0026auto=format\u0026n=OQ5B17YmedKOM4zs\u0026q=85\u0026s=a11f73fac1ef9254cffa5eb412269198","dark":"https://mintcdn.com/bfl/OQ5B17YmedKOM4zs/logo/logo_dark.png?fit=max\u0026auto=format\u0026n=OQ5B17YmedKOM4zs\u0026q=85\u0026s=d933d5452b84db18fc87cd6321e33d08"},"favicon":"https://mintcdn.com/bfl/OQ5B17YmedKOM4zs/favicon.ico?fit=max\u0026auto=format\u0026n=OQ5B17YmedKOM4zs\u0026q=85\u0026s=d0fe6b872ae546a0581d176dfb8726ce","api":{"openapi":["https://api.bfl.ai/openapi.json","https://api.bfl.ai/v1/licenses/docs/openapi.json"]},"background":{"color":{"light":"#f3f1e6","dark":"#07130e"}},"navbar":{"links":[{"href":"https://help.bfl.ai","label":"Help Center"},{"href":"https://status.bfl.ai","label":"API Status"},{"href":"https://bfl.ai/pricing","label":"API Pricing"}],"primary":{"type":"button","label":"Get API Key","href":"https://dashboard.bfl.ai/"}},"footer":{"socials":{"x":"https://x.com/bfl_ai","github":"https://github.com/black-forest-labs","linkedin":"https://www.linkedin.com/company/bflai"},"links":[{"header":"Legal","items":[{"label":"Impressum","href":"https://bfl.ai/legal/imprint"},{"label":"Developer Terms of Service","href":"https://bfl.ai/legal/developer-terms-of-service"},{"label":"Flux API Service Terms","href":"https://bfl.ai/legal/flux-api-service-terms"},{"label":"Terms of Use","href":"https://bfl.ai/legal/terms-of-use"},{"label":"Responsible AI Development Policy","href":"https://bfl.ai/legal/responsible-ai-development-policy"},{"label":"Usage Policy","href":"https://bfl.ai/legal/usage-policy"},{"label":"Intellectual Property Policy","href":"https://bfl.ai/legal/intellectual-property-policy"},{"label":"Privacy Policy","href":"https://bfl.ai/legal/privacy-policy"}]},{"header":"Company","items":[{"label":"Careers","href":"https://bfl.ai/careers"},{"label":"Help Center","href":"https://help.bfl.ai/"},{"label":"Contact","href":"https://bfl.ai/contact"}]}]},"fonts":{"family":"Instrument Sans"},"integrations":{"posthog":{"apiKey":"phc_S5D9NAXVC6BGl2PWlhihIW6IcKFYloe6zvUZW9SU1Bu","apiHost":"https://eu.i.posthog.com"}},"banner":{"content":"Introducing FLUX 3 Image Klein, open weights • [Learn more](/flux_3/flux3_image_klein)","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"thumbnails":{"background":"https://cdn.sanity.io/images/2gpum2i6/production/7a2a3a2a8d594db99b03a24b413a3f59da2f7e9e-2401x1284.jpg"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bfl","hasAudioNarration":false,"actualSubdomain":"bfl","customDomains":["docs.bfl.ml","docs.bfl.ai"],"gitSource":{"type":"github","owner":"black-forest-labs","repo":"dokumentation","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae17124b6ab3649b9955ab9","collectionId":"9ec03e9a-881f-46f9-a9b0-e4e20aee3335","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae17124b6ab3649b9955ab9"},"feedback":{"thumbs":true,"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae17124b6ab3649b9955ab9","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"Documentation","count":135},{"language":"default","tag":"Prompting Guide","count":54},{"language":"default","tag":"API Reference","count":31},{"language":"default","tag":"Use Cases with FLUX","count":21},{"language":"default","tag":"FLUX Tools","count":13},{"language":"default","tag":"Legacy Models","count":13},{"language":"default","tag":"FLUX 3","count":13},{"language":"default","tag":"Editing Use Cases","count":11},{"language":"default","tag":"Text-to-Image Use Cases","count":9},{"language":"default","tag":"Image Generation with FLUX","count":7}],"searchSettings":{"showContentSnippets":true}},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":true},"customCss":[{"filePath":"style.css","href":"/_mintlify/custom/bfl/28e9cddcb212eb2a/style.css"}],"page":{"pagePath":"quick_start/generating_images","slug":"/quick_start/generating_images","pageMetadata":{"title":"Image Generation with Text Prompts","sidebarTitle":"Image Generation","description":"Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.","href":"/quick_start/generating_images"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,CodeBlock,CodeGroup,Heading,Note,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Our API endpoints enable media creation with BFL models. It follows an asynchronous design, where you first make a request for a generation and then query for the result of your request.`}),`\n`,_jsx(Heading,{level:`2`,id:`api-endpoints`,children:`API Endpoints`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Primary Global Endpoint`,id:`primary-global-endpoint`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`api.bfl.ai`})}),` - Recommended for most use cases`]}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Routes requests across all available clusters globally`}),`\n`,_jsx(_components.li,{children:`Automatic failover between clusters for enhanced uptime`}),`\n`,_jsx(_components.li,{children:`Intelligent load distribution prevents bottlenecks during high traffic`}),`\n`]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`Always use the `,_jsx(_components.code,{children:`polling_url`}),` returned in responses when using this endpoint`]})})]}),_jsxs(Accordion,{title:`Regional Endpoints`,id:`regional-endpoints`,children:[_jsxs(_components.p,{children:[`🇪🇺 `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`api.eu.bfl.ai`})}),` - European Multi-cluster`]}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Multi-cluster routing limited to EU regions`}),`\n`,_jsx(_components.li,{children:`GDPR compliant`}),`\n`]}),_jsxs(_components.p,{children:[`🇺🇸 `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`api.us.bfl.ai`})}),` - US Multi-cluster`]}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Multi-cluster routing limited to US regions`}),`\n`]})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`For enhanced reliability and performance, we recommend using the global endpoint `,_jsx(_components.code,{children:`api.bfl.ai`}),` or regional endpoints `,_jsx(_components.code,{children:`api.eu.bfl.ai`}),`/`,_jsx(_components.code,{children:`api.us.bfl.ai`}),` for inference tasks.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`available-endpoints`,children:`Available Endpoints`}),`\n`,_jsx(_components.p,{children:`We currently support the following endpoints for image generation:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-2-max`})}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`/flux-2-pro-preview`}),` — our latest FLUX.2 [pro]`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`/flux-2-pro`}),` — a fixed snapshot of FLUX.2 [pro] for workflows that require reproducibility`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-2-flex`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-2-klein-4b`})}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`/flux-2-klein-9b-preview`}),` — our latest FLUX.2 [klein] 9B with KV caching`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`/flux-2-klein-9b`}),` — a fixed snapshot of FLUX.2 [klein] 9B for reproducibility`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-kontext-max`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-kontext-pro`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-pro-1.1-ultra`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-pro-1.1`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-pro`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`/flux-dev`})}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Preview endpoints (`,_jsx(_components.code,{children:`flux-2-pro-preview`}),`, `,_jsx(_components.code,{children:`flux-2-klein-9b-preview`}),`) reflect our latest advances and are the best place to start. Choose non-preview endpoints when you need a pinned model for reproducibility. See `,_jsx(_components.a,{href:`/flux_2/flux2_overview#preview-endpoints`,children:`Preview Endpoints`}),` for details.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`create-your-first-image`,children:`Create Your First Image`}),`\n`,_jsx(Heading,{level:`3`,id:`submit-generation-request`,children:`Submit Generation Request`}),`\n`,_jsxs(_components.p,{children:[`To submit an image generation task, create a request. This example uses `,_jsx(_components.code,{children:`flux-2-pro-preview`}),`, our latest and most capable model:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`submit_request.sh`,numberOfLines:`19`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`19`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Install curl and jq, then run:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Make sure to set your API key: export BFL_API_KEY=\"your_key_here\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.bfl.ai/v1/flux-2-pro-preview'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'accept: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"x-key: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BFL_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"width\": 1440,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"height\": 2048`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $request`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`polling_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .polling_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"Request ID: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request_id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"Polling URL: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`polling_url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`submit_request.py`,numberOfLines:`24`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`24`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Install requests: pip install requests`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`request `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.bfl.ai/v1/flux-2-pro-preview'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'accept'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BFL_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'prompt'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'width'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1440`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'height'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2048`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).json()`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(request)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`request_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` request[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`polling_url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` request[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"polling_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Request ID: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`request_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Polling URL: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`polling_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`A successful response will be a JSON object containing the request’s `,_jsx(_components.code,{children:`id`}),` and a `,_jsx(_components.code,{children:`polling_url`}),` that should be used to retrieve the result.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Important:`}),` When using the global endpoint (`,_jsx(_components.code,{children:`api.bfl.ai`}),`) or regional endpoints (`,_jsx(_components.code,{children:`api.eu.bfl.ai`}),`, `,_jsx(_components.code,{children:`api.us.bfl.ai`}),`), you must use the `,_jsx(_components.code,{children:`polling_url`}),` returned in the response for checking request status.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`poll-for-results`,children:`Poll for Results`}),`\n`,_jsxs(_components.p,{children:[`To retrieve the result, poll the endpoint using the `,_jsx(_components.code,{children:`polling_url`}),`:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`poll_results.sh`,numberOfLines:`23`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`23`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# This assumes that the request_id and polling_url variables are set from the previous step`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`do`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` sleep`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.5`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'GET'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`polling_url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'accept: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"x-key: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BFL_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Status: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Ready\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` then`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Result: $(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .result.sample `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c\u003c\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $result`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`)\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` then`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Generation failed: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$result`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` fi`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`done`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`poll_results.py`,numberOfLines:`24`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`24`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# This assumes request_id and polling_url are set from the previous step`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polling_url,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'accept'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BFL_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ).json()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` status `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Status: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` status `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Ready\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Result: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'result'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'sample'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` status `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Generation failed: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`A successful response will be a JSON object containing the result, where `,_jsx(_components.code,{children:`result['sample']`}),` is a signed URL for retrieval.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Our signed URLs are only valid for 10 minutes. Please retrieve your result within this timeframe.`})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Image Delivery:`}),` The `,_jsx(_components.code,{children:`result.sample`}),` URLs are served from region-specific delivery endpoints under `,_jsx(_components.code,{children:`delivery.*.bfl.ai`}),`. Region identifiers are subject to change as we add or remove clusters, so if you need to whitelist these hosts, whitelist the wildcard `,_jsx(_components.code,{children:`delivery.*.bfl.ai`}),` rather than individual regions. These URLs are not meant to be served directly to users — we recommend downloading the image and re-serving it from your own infrastructure. We do not enable CORS on delivery URLs.`]})}),`\n`,_jsxs(_components.p,{children:[`See our `,_jsx(_components.a,{href:`https://docs.bfl.ai/api-reference/`,children:`reference documentation`}),` for a full list of options and our `,_jsx(_components.a,{href:`https://github.com/black-forest-labs/flux`,children:`inference repo`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Rate Limits:`}),` Sending requests to our API is limited to 24 active tasks. If you exceed your limit, you’ll receive a status code `,_jsx(_components.code,{children:`429`}),` and must wait until one of your previous tasks has finished.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Rate Limits:`}),` Additionally, due to capacity issues, for `,_jsx(_components.code,{children:`flux-kontext-max`}),`, requests to our API are limited to 6 active tasks.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Credits:`}),` If you run out of credits (status code `,_jsx(_components.code,{children:`402`}),`), visit `,_jsx(_components.a,{href:`https://api.bfl.ai`,children:`https://api.bfl.ai`}),`, sign in and click “Add” to buy additional credits. See also `,_jsx(_components.a,{href:`https://docs.bfl.ai/account_management/credits_billing`,children:`Credits \u0026 Billing`}),`.`]})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`If you require higher volumes, please contact us at `,_jsx(_components.a,{href:`mailto:flux@blackforestlabs.ai`,children:`flux@blackforestlabs.ai`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Image Generation with Text Prompts","sidebarTitle":"Image Generation","description":"Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.","href":"/quick_start/generating_images"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"API Endpoints","slug":"api-endpoints","depth":2,"children":[]},{"title":"Available Endpoints","slug":"available-endpoints","depth":2,"children":[]},{"title":"Create Your First Image","slug":"create-your-first-image","depth":2,"children":[{"title":"Submit Generation Request","slug":"submit-generation-request","depth":3,"children":[]},{"title":"Poll for Results","slug":"poll-for-results","depth":3,"children":[]}]},{"title":"Limits","slug":"limits","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/bfl/589dc04dc07c9b1b/analytics.js"],"subdomain":"bfl","siteName":"Black Forest Labs","title":"Image Generation with Text Prompts - Black Forest Labs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-29T12:26:36.990Z","originalFileLocation":"quick_start/generating_images.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Black Forest Labs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Image Generation with Text Prompts - Black Forest Labs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Black Forest Labs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bfl.ml/quick_start/generating_images\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bfl.mintlify.app/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Image+Generation+with+Text+Prompts\u0026amp;description=Complete+guide+to+FLUX+API+endpoints+for+AI+image+generation.+Learn+text-to-image+creation%2C+API+polling%2C+regional+endpoints%2C+and+code+examples.\u0026amp;theme=a70df1157b5b08d96e98c16c\u0026amp;signature=a1fe7970de09e138607e75763f9c0ba02b08a1daf3165fb518917e5f019cc4ba\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Image Generation with Text Prompts - Black Forest Labs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Complete guide to FLUX API endpoints for AI image generation. Learn text-to-image creation, API polling, regional endpoints, and code examples.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bfl.mintlify.app/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Image+Generation+with+Text+Prompts\u0026amp;description=Complete+guide+to+FLUX+API+endpoints+for+AI+image+generation.+Learn+text-to-image+creation%2C+API+polling%2C+regional+endpoints%2C+and+code+examples.\u0026amp;theme=a70df1157b5b08d96e98c16c\u0026amp;signature=a1fe7970de09e138607e75763f9c0ba02b08a1daf3165fb518917e5f019cc4ba\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/bfl/qSW9OJZxslZOxxB1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Black Forest Labs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#486A58\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bfl.ml/quick_start/generating_images\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/quick_start/generating_images.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Black Forest Labs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Black Forest Labs","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open-cover","tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"The frontier of visual intelligence","sidebarTitle":"Overview","mode":"wide","href":"/quick_start/introduction"},{"title":"Quick Start","sidebarTitle":"Quick Start","mode":"wide","href":"/quick_start/get_started"},{"title":"Overview","sidebarTitle":"API Pricing","href":"/quick_start/pricing"}]},{"group":"Account Management","pages":[{"title":"Organizations \u0026 Projects","sidebarTitle":"Organizations \u0026 Projects","href":"/account_management/organizations_projects"},{"title":"Team Management","sidebarTitle":"Team Management","href":"/account_management/team_management"},{"title":"Credits \u0026 Billing","sidebarTitle":"Credits \u0026 Billing","href":"/account_management/credits_billing"}]},{"group":"FLUX 3","pages":[{"group":"Video","pages":[{"title":"FLUX 3 Video","sidebarTitle":"Overview","mode":"wide","href":"/flux_3/flux3_overview"},{"title":"Video","sidebarTitle":"Generate video","mode":"wide","href":"/flux_3/flux3_video"}]},{"group":"Image","pages":[{"title":"FLUX 3 Image","sidebarTitle":"Overview","href":"/flux_3/flux3_image_overview"},{"title":"FLUX 3 Text to Image","sidebarTitle":"FLUX 3 Text to Image","href":"/flux_3/flux3_image_generate"},{"title":"FLUX 3 Image Editing","sidebarTitle":"FLUX 3 Image Editing","href":"/flux_3/flux3_image_layout"},{"title":"Bounding boxes with FLUX 3 Image","sidebarTitle":"Bounding boxes","href":"/flux_3/flux3_image_bounding_boxes"},{"title":"FLUX 3 Image Klein","sidebarTitle":"FLUX 3 Image Klein","href":"/flux_3/flux3_image_klein"}]},{"group":"Action","pages":[{"title":"FLUX 3 Action","sidebarTitle":"Overview","href":"/flux_3/flux3_action_overview"},{"title":"Run FLUX 3 Action","sidebarTitle":"Run the model","href":"/flux_3/flux3_action_inference"},{"title":"Fine-tune FLUX 3 Action","sidebarTitle":"Fine-tuning","href":"/flux_3/flux3_action_finetuning"},{"title":"SO-101 with LeRobot","sidebarTitle":"SO-101 with LeRobot","href":"/flux_3/flux3_action_so101"},{"title":"Example: FLUX 3 Action plays video games","sidebarTitle":"Example: a video game","href":"/flux_3/flux3_action_games"},{"title":"Example: teach FLUX 3 Action to fly a drone","sidebarTitle":"Example: a drone","href":"/flux_3/flux3_action_drone"}]}]},{"group":"FLUX.2","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/flux_2/flux2_overview"},{"title":"FLUX.2 Image Editing","sidebarTitle":"FLUX.2 Image Editing","href":"/flux_2/flux2_image_editing"},{"title":"FLUX.2 Text to Image","sidebarTitle":"FLUX.2 Text to Image","href":"/flux_2/flux2_text_to_image"}]},{"group":"FLUX Tools","pages":[{"title":"FLUX Video Edit","sidebarTitle":"FLUX Video Edit","href":"/flux_tools/flux_video_edit"},{"title":"FLUX Video Upscale","sidebarTitle":"FLUX Video Upscale","href":"/flux_tools/flux_video_upscale"},{"title":"FLUX Outpainting","sidebarTitle":"FLUX Outpainting","href":"/flux_tools/flux_outpainting"},{"title":"FLUX Erase","sidebarTitle":"FLUX Erase","href":"/flux_tools/flux_erase"},{"title":"FLUX Deblur","sidebarTitle":"FLUX Deblur","href":"/flux_tools/flux_deblur"},{"title":"FLUX Virtual Try-On (VTO)","sidebarTitle":"FLUX Virtual Try-On","href":"/flux_tools/flux_vto"}]},{"group":"API Integration","pages":[{"title":"FLUX API Integration Guide","sidebarTitle":"Integration Guide","href":"/api_integration/integration_guidelines"},{"title":"FLUX MCP server","sidebarTitle":"MCP \u0026 Agent Skills","mode":"wide","href":"/api_integration/mcp_integration"},{"title":"Errors","sidebarTitle":"Errors","href":"/api_integration/errors"}]},{"group":"Training","pages":[{"title":"FLUX.2 [klein] Training","sidebarTitle":"FLUX.2 [klein] Training","href":"/flux_2/flux2_klein_training"},{"title":"FLUX.2 [klein] Style Training","sidebarTitle":"FLUX.2 [klein] Style Training","href":"/flux_2/flux2_klein_training_example"}]},{"group":"Legacy Models","pages":[{"group":"FLUX.1 Kontext","pages":[{"title":"Introduction","sidebarTitle":"Introduction","href":"/kontext/kontext_overview"},{"title":"Image Generation","sidebarTitle":"Image Generation","href":"/kontext/kontext_text_to_image"},{"title":"Image Editing","href":"/kontext/kontext_image_editing"}]},{"group":"FLUX1.1 [pro] Models","pages":[{"title":"FLUX1.1 [pro] Image Generation","sidebarTitle":"FLUX1.1 [pro]","href":"/flux_models/flux_1_1_pro"},{"title":"FLUX1.1 [pro] Ultra Mode","sidebarTitle":"FLUX1.1 [pro] Ultra / Raw","href":"/flux_models/flux_1_1_pro_ultra_raw"}]},{"group":"FLUX.1 Tools","pages":[{"title":"FLUX.1 Fill [pro]","href":"/flux_1_fill"}]}]}]},{"tab":"Cookbook","hidden":true,"searchable":true,"pages":[{"title":"Cookbook","sidebarTitle":"Overview","href":"/cookbook/overview"},{"group":"Video","pages":[{"title":"Video quickstart","sidebarTitle":"Video quickstart","href":"/cookbook/video_quickstart"},{"title":"Start a video from images","sidebarTitle":"Start from images","href":"/cookbook/video_start_from_images"},{"title":"Recast and continue video","sidebarTitle":"Recast and continue","href":"/cookbook/video_edit_recast_continue"},{"title":"Multi-shot films","sidebarTitle":"Multi-shot films","href":"/cookbook/video_multishot_films"}]}]},{"tab":"Prompting Guide","groups":[{"group":"Video Generation with FLUX","pages":[{"title":"Video Generation with FLUX","sidebarTitle":"Overview","mode":"wide","href":"/guides/prompting_video_overview"},{"title":"Text-to-Video","sidebarTitle":"Text-to-Video","href":"/guides/prompting_video_text_to_video"},{"title":"Audio and speech","sidebarTitle":"Audio and speech","href":"/guides/prompting_video_audio"},{"title":"Image-to-Video","sidebarTitle":"Image-to-Video","href":"/guides/prompting_video_image_to_video"},{"title":"Video Editing","sidebarTitle":"Video Editing","href":"/guides/prompting_video_editing"},{"title":"Examples \u0026 Cheatsheet","sidebarTitle":"Examples \u0026 Cheatsheet","mode":"wide","href":"/guides/prompting_video_camera_terms"}]},{"group":"Image Generation with FLUX","pages":[{"title":"FLUX Prompting Guide","sidebarTitle":"Overview","href":"/guides/prompting_summary"},{"title":"Prompting Basics","sidebarTitle":"Prompting Basics","href":"/guides/prompting_unified_basics"},{"title":"Building a Good Prompt","sidebarTitle":"Building a Good Prompt","href":"/guides/prompting_unified_building"},{"title":"Style, Aesthetics \u0026 Text","sidebarTitle":"Style, Aesthetics \u0026 Text","href":"/guides/prompting_unified_style"},{"title":"Technical Parameters","sidebarTitle":"Technical Parameters","href":"/guides/prompting_unified_technical"},{"title":"Layout prompts","sidebarTitle":"Layout prompts","href":"/guides/prompting_layout"},{"title":"Prompt Reference","sidebarTitle":"Prompt Reference","href":"/guides/prompting_unified_reference"}]},{"group":"Image Editing with FLUX","pages":[{"title":"Image Editing","sidebarTitle":"Image Editing","href":"/guides/prompting_editing_overview"},{"title":"Single-Reference Editing","sidebarTitle":"Single-Reference Editing","href":"/guides/prompting_editing_single_reference"},{"title":"Multi-Reference Editing","sidebarTitle":"Multi-Reference Editing","href":"/guides/prompting_editing_multi_reference"}]},{"group":"Use Cases with FLUX","pages":[{"title":"Use Cases","sidebarTitle":"Use Cases","mode":"wide","href":"/guides/prompting_unified_usecases"},{"group":"Text-to-Image Use Cases","pages":[{"title":"Photorealistic Images","sidebarTitle":"Photorealistic Images","mode":"wide","href":"/guides/usecases_t2i_photorealistic"},{"title":"HEX Color Code Prompting","sidebarTitle":"HEX Color Prompting","mode":"wide","href":"/guides/usecases_t2i_hex_color_prompting"},{"title":"JSON Structured Prompting","sidebarTitle":"JSON Prompting","href":"/guides/usecases_t2i_json_prompting"},{"title":"Typography \u0026 Design","sidebarTitle":"Typography \u0026 Design","mode":"wide","href":"/guides/usecases_t2i_typography_design"},{"title":"Infographics","sidebarTitle":"Infographics","mode":"wide","href":"/guides/usecases_t2i_infographics"},{"title":"Multi-Language Prompting","sidebarTitle":"Multi-Language","href":"/guides/usecases_t2i_multi_language"},{"title":"World Knowledge","sidebarTitle":"World Knowledge","mode":"wide","href":"/guides/usecases_t2i_world_knowledge"},{"title":"UI Mockups","sidebarTitle":"UI Mockups","mode":"wide","href":"/guides/usecases_t2i_ui_mockups"},{"title":"Product Mockups","sidebarTitle":"Product Mockups","mode":"wide","href":"/guides/usecases_t2i_product_mockups"}]},{"group":"Outdated","hidden":true,"pages":[{"title":"Logo Generation","sidebarTitle":"Logo Generation","mode":"wide","href":"/guides/usecases_t2i_logo_generation"},{"title":"Style Transfer","sidebarTitle":"Style Transfer","mode":"wide","href":"/guides/usecases_t2i_style_transfer"},{"title":"Interior Design","sidebarTitle":"Interior Design","mode":"wide","href":"/guides/usecases_t2i_interior_design"},{"title":"Virtual Clothing Try-On","sidebarTitle":"Virtual Clothing Try-On","mode":"wide","href":"/guides/usecases_t2i_clothing_tryon"},{"title":"Lighting and Weather Transformation","sidebarTitle":"Lighting \u0026 Weather","mode":"wide","href":"/guides/usecases_t2i_lighting_weather"},{"title":"Object Removal","sidebarTitle":"Object Removal","href":"/guides/usecases_t2i_object_removal"},{"title":"Insert the Person Into a Scene","sidebarTitle":"Person Into a Scene","href":"/guides/usecases_t2i_person_in_scene"},{"title":"Multi-Image Referencing and Compositing","sidebarTitle":"Multi-Image Compositing","href":"/guides/usecases_t2i_multi_image_compositing"},{"title":"3D Pop-Up Card \u0026 Paper Art","sidebarTitle":"3D Pop-Up Card","mode":"wide","href":"/guides/usecases_t2i_3d_popup_card"},{"title":"Action Figure / Plush","sidebarTitle":"Action Figure / Plush","mode":"wide","href":"/guides/usecases_t2i_action_figure"},{"title":"Children's Book Art","sidebarTitle":"Children's Book Art","mode":"wide","href":"/guides/usecases_t2i_childrens_book"}]},{"group":"Editing Use Cases","pages":[{"title":"Style Transfer","sidebarTitle":"Style Transfer","mode":"wide","href":"/guides/usecases_editing_style_transfer"},{"title":"Fashion","sidebarTitle":"Fashion","mode":"wide","href":"/guides/usecases_editing_clothing_tryon"},{"title":"Drawing to Image (Rendering)","sidebarTitle":"Drawing to Image","mode":"wide","href":"/guides/usecases_editing_drawing_rendering"},{"title":"Lighting and Weather Transformation","sidebarTitle":"Lighting \u0026 Weather","mode":"wide","href":"/guides/usecases_editing_lighting_weather"},{"title":"Object Removal","sidebarTitle":"Object Removal","mode":"wide","href":"/guides/usecases_editing_object_removal"},{"title":"Interior Design","sidebarTitle":"Interior Design","mode":"wide","href":"/guides/usecases_editing_interior_design"},{"title":"Product Consistency","sidebarTitle":"Product Consistency","mode":"wide","href":"/guides/usecases_editing_product_consistency"},{"title":"Character \u0026 Style Consistency","sidebarTitle":"Character \u0026 Style Consistency","mode":"wide","href":"/guides/usecases_editing_character_consistency"},{"title":"Insert the Person Into a Scene","sidebarTitle":"Person Into a Scene","mode":"wide","href":"/guides/usecases_editing_person_in_scene"},{"title":"Multi-Image Referencing and Compositing","sidebarTitle":"Multi-Image Compositing","mode":"wide","href":"/guides/usecases_editing_multi_image_compositing"},{"title":"Pose \u0026 Layout Guidance","sidebarTitle":"Pose \u0026 Layout Guidance","mode":"wide","href":"/guides/usecases_editing_controlnets"}]}]}]},{"tab":"API Reference","groups":[{"group":"General","pages":[{"title":"Get Result","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json get /v1/get_result","href":"/api-reference/utility/get-result"},{"title":"Get the user's credits","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json get /v1/credits","href":"/api-reference/get-the-users-credits"}]},{"group":"FLUX 3 Models","pages":[{"title":"Generate a video with FLUX 3","sidebarTitle":"FLUX 3 Video","openapi":"https://api.bfl.ai/openapi.json POST /v1/flux-3-video","href":"/api-reference/utility/generate-a-video-with-flux-3"},{"title":"Generate an image with FLUX 3","sidebarTitle":"FLUX 3 Image","openapi":"https://api.bfl.ai/openapi.json POST /v1/flux-3-image","href":"/api-reference/utility/generate-an-image-with-flux-3"},{"title":"Generate an image with FLUX 3 Klein","sidebarTitle":"FLUX 3 Image Klein","openapi":"https://api.bfl.ai/openapi.json POST /v1/flux-3-image-klein","href":"/api-reference/utility/generate-an-image-with-flux-3-klein"}]},{"group":"FLUX.2 Models","pages":[{"title":"Generate or edit an image with FLUX.2 [max]","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [max]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-max","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[max]"},{"title":"Generate or edit an image with FLUX.2 [pro]","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [pro]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-pro","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[pro]"},{"title":"Generate or edit an image with FLUX.2 [pro] (preview)","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [pro] (preview)","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-pro-preview","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[pro]-preview"},{"title":"Generate or edit an image with FLUX.2 [flex]","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [flex]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-flex","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[flex]"}]},{"group":"FLUX.2 Klein Models","pages":[{"title":"Generate or edit an image with FLUX.2 [klein] 9B (preview)","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [klein] 9B (preview)","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-klein-9b-preview","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[klein]-9b-preview"},{"title":"Generate or edit an image with FLUX.2 [klein] 9B","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [klein] 9B","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-klein-9b","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[klein]-9b"},{"title":"Generate or edit an image with FLUX.2 [klein] 4B","deprecated":null,"version":null,"sidebarTitle":"FLUX.2 [klein] 4B","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-2-klein-4b","href":"/api-reference/models/generate-or-edit-an-image-with-flux2-[klein]-4b"}]},{"group":"FLUX Tools","pages":[{"title":"Edit a video","sidebarTitle":"FLUX Video Edit","openapi":"https://api.bfl.ai/openapi.json POST /v1/flux-tools/video-edit-v1","href":"/api-reference/tools/video-edit"},{"title":"Upscale a video with FLUX 3.","deprecated":null,"version":null,"sidebarTitle":"Video Upscale","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-tools/video-upscale-v1","href":"/api-reference/models/upscale-a-video-with-flux-3"},{"title":"Outpaint or extend an image","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/flux-tools/outpainting-v1","href":"/api-reference/models/outpaint-or-extend-an-image"},{"title":"Erase an object from an image","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/flux-tools/erase-v1","href":"/api-reference/models/erase-an-object-from-an-image"},{"title":"Remove blur from an image","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/flux-tools/deblur-v1","href":"/api-reference/models/remove-blur-from-an-image"},{"title":"Virtual try-on (v2)","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/flux-tools/vto-v2","href":"/api-reference/models/virtual-try-on-v2"},{"title":"Virtual try-on","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/flux-tools/vto-v1","href":"/api-reference/models/virtual-try-on"}]},{"group":"Legacy Models","pages":[{"title":"Edit or create an image with FLUX.1 Kontext [pro]","deprecated":null,"version":null,"sidebarTitle":"FLUX.1 Kontext [pro]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-kontext-pro","href":"/api-reference/models/edit-or-create-an-image-with-flux1-kontext-[pro]"},{"title":"Edit or create an image with FLUX.1 Kontext [max]","deprecated":null,"version":null,"sidebarTitle":"FLUX.1 Kontext [max]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-kontext-max","href":"/api-reference/models/edit-or-create-an-image-with-flux1-kontext-[max]"},{"title":"Generate an image with FLUX1.1 [pro]","deprecated":null,"version":null,"sidebarTitle":"FLUX1.1 [pro]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-pro-1.1","href":"/api-reference/models/generate-an-image-with-flux11-[pro]"},{"title":"Generate an image with FLUX1.1 [pro] ultra mode","deprecated":null,"version":null,"sidebarTitle":"FLUX1.1 [pro] ultra","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-pro-1.1-ultra","href":"/api-reference/models/generate-an-image-with-flux11-[pro]-ultra-mode"},{"title":"Generate an image with FLUX.1 [dev]","deprecated":null,"version":null,"sidebarTitle":"FLUX.1 [dev]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-dev","href":"/api-reference/models/generate-an-image-with-flux1-[dev]"},{"title":"Inpaint an image with FLUX.1 Fill [pro] using an input image and mask","deprecated":null,"version":null,"sidebarTitle":"FLUX.1 Fill [pro]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-pro-1.0-fill","href":"/api-reference/models/inpaint-an-image-with-flux1-fill-[pro]-using-an-input-image-and-mask"},{"title":"Expand an image with FLUX.1 Expand [pro] by adding pixels on any side","deprecated":null,"version":null,"sidebarTitle":"FLUX.1 Expand [pro]","openapi":"https://api.bfl.ai/openapi.json post /v1/flux-pro-1.0-expand","href":"/api-reference/models/expand-an-image-with-flux1-expand-[pro]-by-adding-pixels-on-any-side"}]},{"group":"Fine-tuning","pages":[{"title":"Finetune Details","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json get /v1/finetune_details","href":"/api-reference/utility/finetune-details"},{"title":"My Finetunes","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json get /v1/my_finetunes","href":"/api-reference/utility/my-finetunes"},{"title":"Delete Finetune","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/delete_finetune","href":"/api-reference/utility/delete-finetune"},{"title":"Generate an image with FLUX 1.1 [pro] finetune with ultra mode.","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/openapi.json post /v1/flux-pro-1.1-ultra-finetuned","href":"/api-reference/models/generate-an-image-with-flux-11-[pro]-finetune-with-ultra-mode"}]},{"group":"Licensing","pages":[{"group":"Models","pages":[{"title":"Report Model Usage","deprecated":null,"version":null,"openapi":"https://api.bfl.ai/v1/licenses/docs/openapi.json post /v1/licenses/models/{model_slug}/usage","href":"/api-reference/models/report-model-usage"}]}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes"}]}]},{"anchor":"Prompting Guide","icon":"graduation-cap","tabs":[{"tab":"Prompting Guide","groups":[{"group":"Video Generation with FLUX","pages":[{"title":"Video Generation with FLUX","sidebarTitle":"Overview","mode":"wide","href":"/guides/prompting_video_overview"},{"title":"Text-to-Video","sidebarTitle":"Text-to-Video","href":"/guides/prompting_video_text_to_video"},{"title":"Audio and speech","sidebarTitle":"Audio and speech","href":"/guides/prompting_video_audio"},{"title":"Image-to-Video","sidebarTitle":"Image-to-Video","href":"/guides/prompting_video_image_to_video"},{"title":"Video Editing","sidebarTitle":"Video Editing","href":"/guides/prompting_video_editing"},{"title":"Examples \u0026 Cheatsheet","sidebarTitle":"Examples \u0026 Cheatsheet","mode":"wide","href":"/guides/prompting_video_camera_terms"}]},{"group":"Image Generation with FLUX","pages":[{"title":"FLUX Prompting Guide","sidebarTitle":"Overview","href":"/guides/prompting_summary"},{"title":"Prompting Basics","sidebarTitle":"Prompting Basics","href":"/guides/prompting_unified_basics"},{"title":"Building a Good Prompt","sidebarTitle":"Building a Good Prompt","href":"/guides/prompting_unified_building"},{"title":"Style, Aesthetics \u0026 Text","sidebarTitle":"Style, Aesthetics \u0026 Text","href":"/guides/prompting_unified_style"},{"title":"Technical Parameters","sidebarTitle":"Technical Parameters","href":"/guides/prompting_unified_technical"},{"title":"Layout prompts","sidebarTitle":"Layout prompts","href":"/guides/prompting_layout"},{"title":"Prompt Reference","sidebarTitle":"Prompt Reference","href":"/guides/prompting_unified_reference"}]},{"group":"Image Editing with FLUX","pages":[{"title":"Image Editing","sidebarTitle":"Image Editing","href":"/guides/prompting_editing_overview"},{"title":"Single-Reference Editing","sidebarTitle":"Single-Reference Editing","href":"/guides/prompting_editing_single_reference"},{"title":"Multi-Reference Editing","sidebarTitle":"Multi-Reference Editing","href":"/guides/prompting_editing_multi_reference"}]},{"group":"Use Cases with FLUX","pages":[{"title":"Use Cases","sidebarTitle":"Use Cases","mode":"wide","href":"/guides/prompting_unified_usecases"}]}]}]},{"anchor":"BFL Homepage","icon":"house","href":"https://bfl.ai"},{"anchor":"Help Center","icon":"question","href":"https://help.bfl.ai"}]},"title":"Image Generation with Text Prompts - Black Forest Labs","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["10e4515597"],"chunks":["BannerMarkdown-CJDb0dYK.js","dist-Cv_O2fky.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-BGBGWFTt.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}