flux-2-pro
Black Forest Labs FLUX.2 on reAPI — async photoreal text-to-image and multi-reference generation in Pro, Max and Flex tiers, up to 4MP with exact pixel sizing.
Black Forest Labs' FLUX.2 on reAPI — photoreal text-to-image and
multi-reference generation (up to 8 images), output up to 4MP, with
exact pixel dimensions when a preset will not do. Three tiers:
flux-2-pro, flux-2-max and flux-2-flex-std. Submit returns a task
id; poll until ready. See current pricing on the
model page.
Billing has two terms: the output resolution and every reference image you attach. See Pricing before you budget for an image-to-image workload.
Quick example
curl https://reapi.ai/api/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-pro",
"prompt": "a cinematic product photograph of an espresso machine",
"resolution": "2MP",
"size": "16:9"
}'import requests
resp = requests.post(
"https://reapi.ai/api/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "flux-2-pro",
"prompt": "a cinematic product photograph of an espresso machine",
"resolution": "2MP",
"size": "16:9",
},
timeout=30,
)
print(resp.json())const resp = await fetch('https://reapi.ai/api/v1/images/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'flux-2-pro',
prompt: 'a cinematic product photograph of an espresso machine',
resolution: '2MP',
size: '16:9',
}),
});
console.log(await resp.json());package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
body := []byte(`{
"model": "flux-2-pro",
"prompt": "a cinematic product photograph of an espresso machine",
"resolution": "2MP",
"size": "16:9"
}`)
req, _ := http.NewRequest("POST",
"https://reapi.ai/api/v1/images/generations", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}Submit response
{
"id": "task_019dfd44b7fd74168541552a3260a623",
"model": "flux-2-pro",
"status": "processing",
"created_at": 1785323949
}Poll GET /api/v1/tasks/{task_id} until status is completed or failed.
Authentication
Authorization: Bearer YOUR_API_KEYCreate a key from your dashboard.
Endpoint
POST https://reapi.ai/api/v1/images/generationsSubmission is asynchronous — the call returns a task id immediately and the
image is retrieved by polling the Tasks API.
Tiers
| Model id | Positioning |
|---|---|
flux-2-pro | Balanced quality and speed. The production default. |
flux-2-max | Highest quality and detail, for work that gets scrutinised. |
flux-2-flex-std | Adds steps and guidance for direct control over sampling. |
All three share one parameter set, except that steps and guidance are
accepted only by flux-2-flex-std.
reAPI also serves FLUX.2 through a second, independent surface under the
flux-2 and flux-2-flex model ids. That surface has a different parameter
set and different tiers, and bills separately — see flux-2.
The -std suffix here exists because the bare flux-2-flex id belongs to
that other surface.
Modes
Mode is implicit in whether you send reference images:
| Input | Mode |
|---|---|
prompt only | Text-to-image |
prompt + image_urls (1–8) | Reference-image generation |
Request body
model — string, required
One of flux-2-pro, flux-2-max, flux-2-flex-std.
prompt — string, required
Description of the image to generate, or the edit to apply to the reference images.
resolution — string, default 2MP
Output resolution tier: 1MP, 2MP, 3MP, 4MP. Applies when size is an
aspect ratio.
Legacy aliases are accepted and map onto the four tiers: 512 / 512P / 1M
→ 1MP, 1K / 1024 → 2MP, 2K / 2048 → 3MP, 4K → 4MP.
size — string, default 1:1
Output aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3,
21:9, 9:21.
A pixel string such as 1024x1536 is also accepted and takes priority over
resolution.
width / height — integer, optional
Exact output dimensions. Must be sent as a pair — one without the other is
a 400. Each side is at least 64 pixels, and width × height must not exceed
4 MP (4,194,304 pixels).
A complete pair has the highest priority and overrides both resolution and
size.
image_urls — array, optional
Up to 8 public http(s) image URLs.
Base64 and data: URIs are rejected across the reAPI platform. Host input
images at a publicly reachable URL first. The output plus all reference
images must not exceed 9 MP combined.
output_format — string, default jpeg
jpeg, png, or webp.
n — integer, default 1
1 is the only supported value; submit concurrent requests for more.
seed — integer, optional
Fix the seed to make a generation reproducible.
prompt_upsampling — boolean, default false
When true, the model rewrites and expands your prompt before generating.
safety_tolerance — integer, default 2
Moderation strictness from 0 (strictest) to 5 (most permissive).
FLUX.2 caps this at 5. The FLUX Kontext models allow 6 — the ranges are
not interchangeable.
steps — integer, optional — flux-2-flex-std only
Sampling steps, 1–50. Sending this to flux-2-pro or flux-2-max
returns a 400.
guidance — number, optional — flux-2-flex-std only
Prompt guidance, 1.5–10. Higher values follow the prompt more closely.
Sending this to flux-2-pro or flux-2-max returns a 400.
fallback — object, optional
reAPI may serve a request on either of two upstreams and automatically retries
on the second one if the first fails to deliver. Send {"enabled": false} to
disable that retry and fail fast instead:
{
"model": "flux-2-pro",
"prompt": "A cinematic city at night",
"fallback": { "enabled": false }
}Your price is unaffected either way — both upstreams bill the same rate for the same request. Turning the retry off trades availability for a faster failure.
Some requests are served by a single upstream regardless, because only one of
the two can honour them exactly and reAPI never relaxes a parameter to make a
request routable: steps, guidance, seed, width / height, a
pixel-string size, a 3MP / 4MP resolution, prompt_upsampling: true, an
explicit output_format, or a safety_tolerance above 2.
Pricing
FLUX.2 bills two terms per request:
credits = ceil((output_usd(tier, resolution) + n_refs × reference_usd(tier)) × 1000)where 1 credit = $0.001 USD. In words:
- Output — priced by tier (
pro/max/flex) × resolution (1MP…4MP). Aspect ratio does not change it. - Reference images — each distinct image in
image_urlsadds a per-image charge at the same tier. A request with three references costs meaningfully more than the same prompt with none. Repeating the same URL does not add a charge and does not add a second reference: duplicates collapse before the request is sent, so[a, a, b]is billed and generated as two references.
Each request produces one image. Failed and rejected requests are not charged.
Exact per-tier credit costs surface on the model page and through the playground estimator before submit.
Response
{
"id": "task_019dfd44b7fd74168541552a3260a623",
"model": "flux-2-pro",
"status": "completed",
"output": {
"image_urls": [
"https://cdn.reapi.ai/...jpg"
]
}
}Generated URLs expire — mirror them to your own storage if you need long-term retention.
Errors
Failures return the standard reAPI envelope { error: { code, message, request_id } }. Common cases:
- Invalid input (empty prompt, more than 8
image_urls, a non-http(s) URL,widthwithoutheight, output over 4 MP,safety_toleranceoutside 0–5, orsteps/guidanceon a non-Flex tier) →400. - Insufficient credits →
402. - Rate limited →
429.
See the full catalog at /docs/api/errors.
Tips
- Reference images are billed per image. If you are iterating on composition, drop to one reference while you explore and add the rest for the final pass.
- Batch jobs that do not need detail should run at
1MP— the resolution tier is the single biggest lever on cost. - Use
width+heightwhen a layout has fixed dimensions; it saves a downstream crop and guarantees the aspect the design expects. - Put text you want rendered in the image in quotes inside the prompt.
- On the Flex tier, raise
guidancewhen the render drifts from the prompt and raisestepswhen it looks under-detailed. Change one at a time.