Skip to main content
POST
/
kling-v2-t2i
/
async
curl --request POST \
  --url https://api.modellix.ai/api/v1/text-to-image/kling/kling-v2-t2i/async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Majestic dragon flying over medieval castle, epic fantasy art"
}
'
{
  "code": 0,
  "message": "success",
  "data": {
    "status": "pending",
    "task_id": "task-ghi789",
    "model_id": "kling-v2-t2i"
  }
}

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json
prompt
string
required

Image description text, supports Chinese and English

Required string length: 1 - 2500
Example:

"Majestic dragon flying over medieval castle, epic fantasy art"

negative_prompt
string

Negative prompt describing undesired elements

Required string length: 1 - 2500
Example:

"cartoon, anime, low quality"

aspect_ratio
enum<string>
default:16:9

Image aspect ratio

Available options:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9
Example:

"16:9"

resolution
enum<string>
default:1k

Image resolution. V2 supports both 1K and 2K

Available options:
1k,
2k
Example:

"2k"

n
integer
default:1

Number of images to generate per request

Required range: 1 <= x <= 9
Example:

1

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required