import requests r = requests.post( "https://api.aimlapi.com/v1/images/generations", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "flux-2", "prompt": "A cat holding a sign that says hello" }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/images/generations", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "flux-2", "prompt": "A cat holding a sign that says hello" }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/images/generations \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"flux-2","prompt":"A cat holding a sign that says hello"}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Output | |
Flux 2 is a professional visual foundation model from Black Forest Labs that combines a powerful vision‑language backbone with a rectified flow transformer to understand both world knowledge and fine‑grained spatial relationships. It is designed to handle text‑to‑image, image‑to‑image, and complex editing inside one architecture, simplifying pipelines for teams that previously juggled multiple models.

By interpreting narrative intent, motion cues, and stylistic direction directly from text, the model generates videos that feel purposeful rather than procedural. Scenes evolve naturally, transitions remain consistent, and visual identity is preserved from the first frame to the last.
Flux.2 Edit API represents the model’s advanced editing layer, focused on controlled, context-aware image refinement. Rather than applying generic filters or destructive edits, it understands the structure and meaning of an image before making changes.
The Flux.2 experience is designed to be intuitive from the first interaction. Users begin by describing an idea or uploading a reference image. The model interprets intent, context, and style preferences before generating a refined visual result.
From there, images can be adjusted incrementally through follow-up instructions, allowing creators to fine-tune details without restarting the process. This conversational approach to image creation makes Flux.2 feel less like a tool and more like a creative collaborator.
Flux.2 stands out by combining expressive generation with reliable editability. Instead of producing static outputs, it supports evolving creative direction, a critical advantage for professional design and content workflows. The model is optimized for speed and scalability, enabling rapid experimentation as well as high-volume asset production. Whether used for branding, storytelling, education, or commercial visuals, Flux.2 adapts seamlessly to different creative demands.
Most importantly, Flux.2 lowers the technical barrier to high-quality visual creation. Complex results no longer require complex software.
You can try this model in the browser before writing any code: open the AI/ML API playground, select the model and send a prompt. Nothing has to be installed locally — an API key is all you need. The same request is shown as cURL, Python and JavaScript in the code examples on this page, so a prompt that works in the playground can be copied straight into an application.
Open the playgroundLorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.Machine-readable API summary for LLM agents (llms.txt)
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
FLUX.2 This page | Image generation at scale | |||
| Image generation at scale | ||||
| Image generation at scale | ||||
| Image generation at scale | ||||
| Image generation at scale |
FLUX.2 takes image, text as input and returns image.
FLUX.2 is priced at $0.0156 / MP (variable).
FLUX.2 is billed per generation — a fixed charge per output rather than by prompt length.
Yes, FLUX.2 accepts image input as well as a text prompt.
FLUX.2 was built by Black Forest Labs.
Send a request to https://api.aimlapi.com/v1/images/generations with flux-2 as the model id.
Yes. FLUX.2 is served through AI/ML API, so the same key and endpoint format used for other models applies.
FLUX.2 is accessed via https://api.aimlapi.com/v1/images/generations.