Black Forest Labs
FLUX 3 Image Klein
flux-3-image-klein
Try flux-3-image-klein
Input
Output
Pricing
flux-3-image-klein per image
| Specifications | Unit Price |
|---|---|
| 768 | $0.0092 |
| 1K | $0.0103 |
| 1.5K | $0.0126 |
| 2K | $0.016 |
| 4K | $0.0412 |
Introduction coming soon
A detailed guide for this model is being prepared. Pricing, parameters and the API docs below are already available.
What's new
View changelog →- New model FLUX 3 Image Klein Now Available: Text-to-Image and Reference Editing
Frequently asked questions
View all FAQs →-
Why do short prompts produce generic images?
Short prompts give the model too little information, so it can only fill in the gaps based on common interpretations, which makes the results feel generic. Writing the prompt as a complete description is far more reliable: ① subject and appearance details ② scene and environment ③ lighting and color tone ④ composition and viewpoint ⑤ style and image-quality requirements. The prompt limit is 5000 characters, which is enough to spell out each item clearly.
-
How do I switch between text-to-image and image editing?
The same model supports two usage modes; the only difference is whether reference images are passed. Omitting image_urls means text-to-image, generating solely from the prompt; passing image_urls switches to instruction-based editing, where the prompt must clearly state which parts of the reference image need to be modified and which need to be preserved. When editing, it is recommended to list each part to be changed and the desired effect one by one, rather than writing just a single sentence about the overall style.
-
How many reference images can be used at most?
image_urls supports a maximum of 10 images and a minimum of 1; once reference images are passed in, it enters edit mode or multi-reference composition mode. For each image, you need to explain its role in the prompt, for example, the first image is the character, the second is the product, and the third is the background style. This upper limit is suitable for composition scenarios that require cross-image consistency of characters or products.
-
How do I control layout composition?
Use the labels in the prompt together with the bbox JSON to specify element positions. In the prompt, write placeholders in the form <label> and attach the corresponding bounding-box JSON to state which region each element goes in, then write the specific description into the content corresponding to each label. This is suitable for images such as posters and banners that require fixed layout positions.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: flux-3-image-klein
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for flux-3-image-klein and route default — see the parameter table below.
seedintegerOptionalmin 0max 4294967295随机种子,用于尽量复现相同参数下的结果。省略时随机。
stepsintegerOptionalDefault: 16min 1max 16扩散步数,1–16;数值越低生成越快,细节可能减少,不影响价格。
promptstringRequiredminLength 1maxLength 5000描述想生成的画面,或说明参考图中需要修改与保留的内容。可用 <标签> 配合 bbox JSON 指定布局与局部编辑区域。
image_urlsarrayOptionalminItems 1maxItems 10提供参考图片,并在提示词中说明每张图片的主体、风格或构图角色。省略即为文生图。
Array [ string ]
resolutionstringOptionalDefault: "1K"选择输出像素档位;具体宽高随画幅变化。
7681K1.5K2K4Kaspect_ratiostringOptionalDefault: "auto"选择横图、竖图或方图;自动模式根据提示词与参考图确定画幅。
21:92:116:93:27:54:35:41:1Show all (8)Show less
4:53:45:72:39:161:29:21autooutput_formatstringOptionalDefault: "jpeg"输出图片格式。
jpegpngsafety_toleranceintegerOptionalDefault: 2min 0max 4内容安全宽容度,0 最严格。
callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-3-image-klein",
"input": {
"steps": 16,
"prompt": "…",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "jpeg",
"safety_tolerance": 2
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "flux-3-image-klein",
input: {
"steps": 16,
"prompt": "…",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "jpeg",
"safety_tolerance": 2
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "flux-3-image-klein",
"input": {
"steps": 16,
"prompt": "…",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "jpeg",
"safety_tolerance": 2
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →Related Models
View all models →Same Type
-
Seedream 5.5 ByteDance $0.019 /image -
Grok Imagine Image 2.0 xAI $0.052 /image -
Qwen Image 3.0 Alibaba $0.036 /image -
Google Virtual Try-On Google $0.107 /image -
BRIA Product Shot Bria $0.058 /image -
Nano Banana 2 Google $0.018 /image -
FLUX.2 Klein 4B Black Forest Labs $0.0004 /image -
Muse Image 1.0 Meta $0.015 per task -
GPT Image 2.5 OpenAI $0.017 /image -
Ideogram V4 Ideogram $0.050 /image -
Grok Imagine xAI $0.011 /second -
Krea 3 Krea $0.036 /image
Same Provider
-
FLUX 3 Max Black Forest Labs $0.121 /second -
FLUX.2 Klein 4B Black Forest Labs $0.0004 /image -
FLUX 3 Image Black Forest Labs $0.041 /image -
FLUX.1 Kontext Max Black Forest Labs $0.071 /image -
FLUX 3 Video Black Forest Labs $0.090 /second -
FLUX.2 Black Forest Labs $0.035 /image -
FLUX.2 Klein 9B Black Forest Labs $0.0086 /image -
FLUX 1.1 Pro Black Forest Labs $0.050 /image -
FLUX.1 Fill Pro Black Forest Labs $0.071 /image -
FLUX.1 Schnell Black Forest Labs $0.005 /image