Skip to content
中文

Flux 3 API documentation

Integrate Flux 3 with your VezAPI key. The operations below share the same authentication and account balance.

Base URL: https://api.vezapi.com
Send Authorization: Bearer YOUR_VEZAPI_KEY. Use a unique Idempotency-Key for each submission; reuse it only when checking the same request.

FLUX 3 Klein Edit Image

POST/api/v1/jobs/createTask

Model IDs: flux-3/klein-edit-image

ParameterTypeDescription & constraints
model
required
string

The model name used for generation. This endpoint must use `flux-3/klein-edit-image`.

Values: "flux-3/klein-edit-image"

Default: "flux-3/klein-edit-image"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. The system POSTs the task status and results to this URL when generation completes. To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification).

input
required
object

Input parameters for the generation task

input.prompt
required
string

An instruction describing how to edit the image (Max length: 5000 characters)

minLength: 1

maxLength: 5000

input.image_urls
required
array

Input images to transform or use as reference (supports up to 10 images) (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 30.0MB)

minItems: 1

maxItems: 10

input.aspect_ratio
optional
string

Aspect ratio of the generated image. Select auto to match the first input image ratio. Options: 1:1; 4:3; 3:4; 3:2; 2:3; 16:9; 9:16; 21:9; 9:21; auto

Values: "1:1", "4:3", "3:4", "3:2", "2:3", "16:9", "9:16", "21:9", "9:21", "auto"

Default: "auto"

input.resolution
optional
string

Resolution of the generated image Options: 1K; 2K; 4K

Values: "1K", "2K", "4K"

Default: "1K"

input.width
optional
integer

Width of the generated image. Both width and height must be passed at the same time. Must be an integer between 256 and 4096. The aspect ratio (width:height) must be between 1:2.5 and 2.5:1. Once passed, aspect_ratio and resolution are ignored.

minimum: 256

maximum: 4096

input.height
optional
integer

Height of the generated image. Both width and height must be passed at the same time. Must be an integer between 256 and 4096. The aspect ratio (width:height) must be between 1:2.5 and 2.5:1. Once passed, aspect_ratio and resolution are ignored.

minimum: 256

maximum: 4096

input.output_format
optional
string

Format of the output image Options: png; jpeg; webp

Values: "png", "jpeg", "webp"

Default: "png"

input.num_images
optional
integer

Number of images to generate

Default: 1

minimum: 1

maximum: 4

input.seed
optional
integer

Random seed

minimum: 0

maximum: 2147483647

input.enhance_prompt
optional
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.

Values: true, false

Default: true

input.nsfw_checker
optional
boolean

Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "flux-3/klein-edit-image",
  "input": {
    "prompt": "Your prompt",
    "image_urls": [
      "Your prompt"
    ],
    "aspect_ratio": "auto",
    "resolution": "1K"
  }
}'
Responses and errors

HTTP 200

Request Successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

FLUX 3 Klein Text to Image

POST/api/v1/jobs/createTask

Model IDs: flux-3/klein-text-to-image

ParameterTypeDescription & constraints
model
required
string

The model name used for generation. This endpoint must use `flux-3/klein-text-to-image`.

Values: "flux-3/klein-text-to-image"

Default: "flux-3/klein-text-to-image"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. The system POSTs the task status and results to this URL when generation completes. To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification).

input
required
object

Input parameters for the generation task

input.prompt
required
string

A text description of the image you want to generate (Max length: 5000 characters)

minLength: 1

maxLength: 5000

input.aspect_ratio
optional
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

Values: "1:1", "4:3", "3:4", "3:2", "2:3", "16:9", "9:16", "21:9", "9:21"

Default: "1:1"

input.resolution
optional
string

Resolution of the generated image Options: 1K; 2K; 4K

Values: "1K", "2K", "4K"

Default: "1K"

input.width
optional
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.

minimum: 256

maximum: 4096

input.height
optional
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.

minimum: 256

maximum: 4096

input.output_format
optional
string

Format of the output image Options: png; jpeg; webp

Values: "png", "jpeg", "webp"

Default: "png"

input.num_images
optional
integer

Number of images to generate

Default: 1

minimum: 1

maximum: 4

input.seed
optional
integer

Random seed

minimum: 0

maximum: 2147483647

input.enhance_prompt
optional
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.

Values: true, false

Default: true

input.nsfw_checker
optional
boolean

Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "flux-3/klein-text-to-image",
  "input": {
    "prompt": "Your prompt",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }
}'
Responses and errors

HTTP 200

Request Successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Task status and callbacks

For asynchronous tasks, keep the returned taskId. Query GET /api/v1/jobs/recordInfo?taskId=... or provide callBackUrl when creating the task. Only the account that created a task can access it or derive new resources from it.

A timeout can mean the submission was accepted. Inspect the existing request in your dashboard; do not create another task automatically. Callback delivery is retried and may arrive more than once. Deduplicate with X-VezAPI-Event-Id.

Files, logs and billing

Generated media normally follows a 14-day provider lifetime; uploaded files expire after 24 hours. Save the files you need before expiration. VezAPI streams registered files without keeping a permanent media library. Request logs are retained for two calendar months.

Credits are reserved before submission. Final deductions match actual discounted consumption one for one. Unknown usage pauses new paid requests. If available funds cannot cover final usage while protecting other reservations, settlement stays pending until funded; model usage cannot make the wallet negative. Time-based inputs require server-side metadata reads; a failed read prevents submission.