Kling V3 Text to Image

Generate photorealistic, print-ready images from text using Kuaishou's Kling V3 — with native 2K output and character consistency.

~48.34s
$0.035 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/kling-3-text2image"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "A majestic snow-capped mountain range at golden hour, reflected in a crystal-clear alpine lake, photorealistic, ultra detailed, cinematic lighting",
12    "negative_prompt": "blurry, low quality, distorted, watermark",
13    "resolution": "1K",
14    "aspect_ratio": "16:9",
15    "output_format": "png"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21    result = response.json()
22    print(json.dumps(result, indent=2))
23else:
24    print(f"Error: {response.status_code}")
25    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/kling-3-text2image

Parameters

promptrequired
string

Describe the desired output. Use parentheses like (element1) to reference elements.

aspect_ratiooptional
string

Frame dimensions for the output image.

Default: "16:9"
Allowed values :
"16:9""9:16""1:1""4:3""3:4""3:2""2:3"
elementsoptional
object[]

Character/object elements to include. Reference in prompt with parentheses like (element1). Max 10 elements.

Array items:
frontal_image_urloptional
string (uri)

Frontal view image of the character or object.

reference_image_urlsoptional
string[]

Up to 3 reference images for this element.

negative_promptoptional
string

Describe elements that should be avoided in the generated image.

output_formatoptional
string

Select output format. Use png for best quality, jpeg for smaller files.

Default: "png"
Allowed values :
PNG"png"
JPEG"jpeg"
WebP"webp"
resolutionoptional
string

Output resolution. 1K for standard, 2K for higher quality.

Default: "1K"
Allowed values :
"1K""2K"

Response Type

Returns: Text/JSON

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out