Flux 2 iconImage APIActive

flux-2 API

Generate photorealistic AI images with the Flux 2 API through API in One. High-quality text-to-image and image-to-image generation. Supports Pro and Flex modes with 1K/2K resolution.

Model IDflux-2

Use this in the request body model field.

Endpoint/api/v1/images/generations

The currently implemented BFF route.

Outputimage

Input types: text, image

AuthBearer API key

Keys are managed by the shared dashboard.

WebhookSupported

Use callback_url on supported async tasks.

Live capabilities

These capabilities come from the current model config and backend route. Unreleased APIs are not listed.

Pro and Flex modes for quality vs speed tradeoff

Pro and Flex modes for quality vs speed tradeoff

1K and 2K resolution support

1K and 2K resolution support

Image

Image-to-image with up to 8 reference images

Webhook support for async workflows

Webhook support for async workflows

Request format

Clients call same-origin API routes; the server BFF forwards to the matching Worker.

Parameters

promptstring

Text description of the image (3–5000 chars)

Required
aspect_ratiostring

Output aspect ratio (e.g. 1:1, 16:9, 9:16)

Optional · Default 1:1
typestring

Generation mode: "pro" (higher quality) or "flex" (faster/cheaper)

Optional · Default pro
resolutionstring

Output resolution: "1K" or "2K"

Optional · Default 1K
input_urlsarray

Array of image URLs for image-to-image (max 8 images)

Optional

Example request

curl -X POST https://apiin.one/api/v1/images/generations \
  -H "Authorization: Bearer aio_your_api_key" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "model": "flux-2",
  "prompt": "A serene Japanese garden with cherry blossoms, koi pond, and wooden bridge, photorealistic",
  "aspect_ratio": "16:9",
  "type": "pro",
  "resolution": "1K"
}'

Models on the same endpoint

These live models use the same implemented BFF endpoint and can be switched by changing the model field.

Integration flow

These steps use the current live route and shared account system; login, payment, orders, credits, and profile remain shared.

01

Create a shared API key

Create a key in the existing dashboard. Top-up, orders, credit balance, and profile stay in the shared console.

02

Call the real endpoint

Send a request with the endpoint, model id, and parameters shown on this page. /api/v1/images/generations

03

Poll task status

Async media and tool jobs use /api/v1/tasks/{task_id}; chat models return a direct response.

Task status route

After creating image, video, audio, or tool tasks, poll the real task endpoint for results.

GET/api/v1/tasks/{task_id}Check generation task status and result.

Pricing

5–24 credits per image (~$0.05–$0.24)

Base cost$0.05
Credits5
BillingSuccessful requests

Use cases

These workflows are supported by the current model and backend node.

01

Generate product mockups and marketing visuals from text descriptions

02

Create AI-generated artwork and illustrations for content

03

Build AI image generation features into your application

04

Produce photorealistic stock images on demand

FAQ

How much does the Flux 2 API cost?

Credits vary by mode and resolution. Pro mode at 1K costs 5 credits, 2K costs 7 credits. Flex mode at 1K costs 14 credits, 2K costs 24 credits. Free credits included on sign up.

What is the difference between Pro and Flex mode?

Pro mode produces higher quality results. Flex mode is faster and cheaper, suitable for rapid iteration. Set the "type" parameter to "pro" or "flex".

Can I use reference images?

Yes. Flux 2 supports image-to-image by providing up to 8 input image URLs via the "input_urls" parameter alongside your text prompt.

What resolutions are supported?

Flux 2 supports 1K and 2K resolution output. Set via the "resolution" parameter.

How do I call Flux 2?

Use POST /api/v1/images/generations with model "flux-2", then poll the returned task ID through /api/v1/tasks/{task_id}.

Related live models