Create text-to-image or single image-to-image task
POST
/v1/images/generations
Generate images from text descriptions (text-to-image) or create new images based on a single reference image (single image-to-image) using the Kling V2.1 model. Returns task ID for subsequent queries
Request
Authorization
API Key
Add parameter in header
Authorization
Example:
Authorization: ********************
or
Body Params application/jsonRequired
Examples
{"model":"kling-v2-1","prompt":"A cute orange cat sitting on the windowsill watching the sunset, photographic style, high definition quality","aspect_ratio":"16:9"}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl--location'https://api-xmodel.nexconn.ai/v1/images/generations' \
--header'Authorization: <api-key>' \
--header'Content-Type: application/json' \
--data'{
"model": "kling-v2-1",
"prompt": "A cute orange cat sitting on the windowsill watching the sunset, photographic style, high definition quality",
"aspect_ratio": "16:9"
}'