All models
Black Forest Labs
Image
Available
FLUX 3 Klein Text to Image
Learn how to check the task status and obtain the generated results
Text to Image
From 60 credits (≈ ₹60.00) per request.
Parameters
| Parameter | Type | Description |
|---|---|---|
promptRequired |
string | A text description of the image you want to generate (Max length: 5000 characters) max length 5000 |
aspect_ratio |
string | Aspect ratio of the generated image Options: 1:1; 4:3; 3:4; 3:2; 2:3; 16:9; 9:16; 21:9; 9:21 one of: "1:1", "4:3", "3:4", "3:2", "2:3", "16:9", "9:16", "21:9", "9:21" · default "1:1" |
resolution |
string | Resolution of the generated image Options: 1K; 2K; 4K one of: "1K", "2K", "4K" · default "1K" |
width |
integer | Image width. Both width and height must be passed at the same time. Aspect ratio must be between 1:2.5 and 2.5:1. Once passed, aspect_ratio and resolution are ignored. min 256 · max 4096 |
height |
integer | Image height. Both width and height must be passed at the same time. Aspect ratio must be between 1:2.5 and 2.5:1. Once passed, aspect_ratio and resolution are ignored. min 256 · max 4096 |
output_format |
string | Format of the output image Options: png; jpeg; webp one of: "png", "jpeg", "webp" · default "png" |
num_images |
integer | Number of images to generate min 1 · max 4 · default 1 |
seed |
integer | Random seed min 0 · max 2147483647 |
enhance_prompt |
boolean | Rewrites the prompt into a fuller description before generating, which noticeably improves quality. Enabled by default (also when the parameter is omitted); pass false to turn it off. Applies to both text-to-image and image editing; in editing, the rewrite preserves the intent of the original instruction. one of: true, false · default true |
nsfw_checker |
boolean | Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model. |
What you get back
Files arrive in output.files[] as private links that expire, with their type and size.
Use it from your code
# 1. Create the task
curl https://nexus.promptscenes.in/api/v1/tasks \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "flux-3-klein-text-to-image",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"aspect_ratio": "1:1",
"resolution": "1K",
"output_format": "png",
"num_images": 1,
"enhance_prompt": true
},
"callback_url": "https://your-app.com/webhooks/nexus"
}'
# 2. Poll for the result
curl https://nexus.promptscenes.in/api/v1/tasks/TASK_ID \
-H "Authorization: Bearer $NEXUS_API_KEY"
import os, time, uuid, requests
API = "https://nexus.promptscenes.in/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['NEXUS_API_KEY']}"}
task = requests.post(
f"{API}/tasks",
headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
json={
"model": "flux-3-klein-text-to-image",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"aspect_ratio": "1:1",
"resolution": "1K",
"output_format": "png",
"num_images": 1,
"enhance_prompt": True,
},
"callback_url": "https://your-app.com/webhooks/nexus",
},
).json()
while task["status"] not in ("succeeded", "failed", "cancelled"):
time.sleep(3)
task = requests.get(f"{API}/tasks/{task['id']}", headers=HEADERS).json()
print(task["status"], task.get("output"))
const API = "https://nexus.promptscenes.in/api/v1";
const headers = {
Authorization: `Bearer ${process.env.NEXUS_API_KEY}`,
"Content-Type": "application/json",
};
let task = await fetch(`${API}/tasks`, {
method: "POST",
headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
body: JSON.stringify({
"model": "flux-3-klein-text-to-image",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"aspect_ratio": "1:1",
"resolution": "1K",
"output_format": "png",
"num_images": 1,
"enhance_prompt": true
},
"callback_url": "https://your-app.com/webhooks/nexus"
}),
}).then((r) => r.json());
while (!["succeeded", "failed", "cancelled"].includes(task.status)) {
await new Promise((r) => setTimeout(r, 3000));
task = await fetch(`${API}/tasks/${task.id}`, { headers }).then((r) => r.json());
}
console.log(task.status, task.output);
Request
{
"model": "flux-3-klein-text-to-image",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"aspect_ratio": "1:1",
"resolution": "1K",
"output_format": "png",
"num_images": 1,
"enhance_prompt": true
}
}
Response
{
"id": "6f1c…",
"object": "task",
"model": "flux-3-klein-text-to-image",
"status": "succeeded",
"output": {
"files": [
{
"url": "https://…signed…",
"mime": "…",
"size": 0
}
]
},
"estimated_cost": "…",
"charged": "…"
}