curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-image-klein",
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
"aspect_ratio": "21:9",
"resolution": "2k"
}'
import requests
response = requests.post(
"https://api.apimart.ai/v1/images/generations",
headers={"Authorization": "Bearer <token>"},
json={
"model": "flux-3-image-klein",
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
"aspect_ratio": "21:9",
"resolution": "2k"
}
)
print(response.json())
const response = await fetch("https://api.apimart.ai/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "flux-3-image-klein",
prompt: "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
aspect_ratio: "21:9",
resolution: "2k"
})
});
console.log(await response.json());
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K..."
}
]
}
FLUX 3 Image Klein
FLUX 3 Image Klein Generation
Text-to-image, single-image editing, and up to 10 reference images, with multiple aspect ratios and resolution up to 4k.
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-image-klein",
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
"aspect_ratio": "21:9",
"resolution": "2k"
}'
import requests
response = requests.post(
"https://api.apimart.ai/v1/images/generations",
headers={"Authorization": "Bearer <token>"},
json={
"model": "flux-3-image-klein",
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
"aspect_ratio": "21:9",
"resolution": "2k"
}
)
print(response.json())
const response = await fetch("https://api.apimart.ai/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "flux-3-image-klein",
prompt: "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
aspect_ratio: "21:9",
resolution: "2k"
})
});
console.log(await response.json());
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K..."
}
]
}
This endpoint is asynchronous. A successful submission returns a
task_id. Use task queries to retrieve status and images. Stop polling when the status is completed or failed. Generating at 4k may take several minutes; a total wait timeout of 10 minutes is recommended.curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-image-klein",
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
"aspect_ratio": "21:9",
"resolution": "2k"
}'
import requests
response = requests.post(
"https://api.apimart.ai/v1/images/generations",
headers={"Authorization": "Bearer <token>"},
json={
"model": "flux-3-image-klein",
"prompt": "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
"aspect_ratio": "21:9",
"resolution": "2k"
}
)
print(response.json())
const response = await fetch("https://api.apimart.ai/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "flux-3-image-klein",
prompt: "Ultra-wide cinematic shot of a fog-drenched coastal highway at dawn, a single vintage car with headlights on",
aspect_ratio: "21:9",
resolution: "2k"
})
});
console.log(await response.json());
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K..."
}
]
}
Request headers
string
required
Bearer authentication in the format
Bearer <token>, where <token> is your APIMart API Key.Request parameters
string
required
Must be
flux-3-image-klein.string
required
A scene description for text-to-image, or image editing instructions. Negative prompts are not supported; describe what you want to see instead.Use tags and bbox JSON within
prompt to specify layouts or local editing regions. See the examples below.string[]
Reference image list, up to 10 images. Supports publicly accessible HTTP(S) URLs or Base64 input.Omit for text-to-image. Provide one image for single-image editing or multiple images for multi-image reference.
string
default:"auto"
Output aspect ratio. Supported values:
21:9, 2:1, 16:9, 3:2, 7:5, 4:3, 5:4, 1:1, 4:5, 3:4, 5:7, 2:3, 9:16, 1:2, 9:21, or auto.Ratio formats such as 16x9 are also accepted. With auto:- Editing or multiple reference images: follows the aspect ratio of the first reference image.
- Text-to-image: determined by the prompt; falls back to
1:1if no aspect ratio is determined.
string
Compatibility parameter for the aspect ratio. Can replace
aspect_ratio and accepts the same values. Use only one of these fields.Pixel dimensions such as 1024x1024 are not supported and return HTTP 400. Use resolution to select the output resolution.string
default:"1k"
Output resolution tier. Supports
768sq, 1k, 1.5k, 2k, and 4k, case-insensitively. 768 is equivalent to 768sq.This parameter determines the billing tier. If omitted, generation and billing use 1k. Unsupported values such as 3k return HTTP 400.integer
default:"2"
Content safety tolerance, from 0–4. 0 is the strictest.
integer
Random seed, from 0 to 4294967295.
integer
default:"16"
Generation steps, from 1 to 16; default: 16. Fewer steps can speed up generation but may reduce image quality. Steps do not affect pricing.
string
default:"jpeg"
Image file format:
jpeg (default) or png; jpg is equivalent to jpeg. webp is not supported and returns HTTP 400.integer
default:"1"
Each request generates 1 image; only
1 is supported. Submit separate tasks for multiple images. Values above 1 return HTTP 400.Unsupported parameters
The following parameters return HTTP 400 when provided; they are not silently ignored:width,height- Pixel dimensions in
size, such as1024x1024 grounding,guidancenegative_prompt,