Theme
Create Task
POST
https://www.kkiai.com/tencent-vod/v1/aigc-image
Official documentation: https://cloud.tencent.com/document/product/266/126240
Request Parameters
Authorization
Add the Authorization parameter to the Header. Its value is the Token concatenated after Bearer.
Example: Authorization: Bearer ********************
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} | |
Content-Type | string | Optional | application/json |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
model_name | string | Required | Model name. Values: GEM: Gemini; Qwen: Qwen. Hunyuan: Hunyuan. Example value: GEM |
model_version | string | Required | Model version. Values: When ModelName is GEM, optional values are 2.5, 3.0; When ModelName is Qwen, optional value is 0925; When ModelName is Hunyuan, optional value is 3.0; Example value: 2.5 |
prompt | string | Required | |
file_infos | array[object] | Optional | |
└ type | string | Optional | Input video file type. Values: File: VOD media file; Url: Accessible URL; Example value: File |
└ file_id | string | Optional | Media file ID of the image file, which is the globally unique identifier of the file in VOD. It is assigned by the VOD backend after successful upload. This field can be obtained from the video upload completion event notification or VOD console. This parameter is valid when Type is File. Note: 1. Images smaller than 7MB are recommended; 2. Image format values are: jpeg, jpg, png, webp. Example value: 3704211***509819 |
└ url | string | Optional | Accessible file URL. This parameter is valid when Type is Url. Note: 1. Images smaller than 7MB are recommended; 2. Image format values are: jpeg, jpg, png, webp. Example value: https://test.com/1.png |
└ text | string | Optional | Description information of the input image to help the model understand the image. Only valid for GEM 2.5 and GEM 3.0. Example value: Task background: This is the main building that needs renovation (Figure 1), and its geometric structure must not be changed. |
negative_prompt | string | Optional | Prompt words to prevent the model from generating images. |
enhance_prompt | string | Optional | Whether to automatically optimize the prompt. When enabled, the input Prompt will be automatically optimized to improve generation quality. Values: Enabled: Enable; Disabled: Disable; |
output_config | object | Optional | Output media file configuration for the image generation task. |
└ storage_mode | string | Optional | Storage mode. Values: Permanent: Permanent storage, generated image files will be stored in VOD and FileId can be obtained in event notifications; Temporary: Temporary storage, generated image files will not be stored in VOD, temporary access URLs can be obtained in event notifications; Default value: Temporary |
└ resolution | string | Optional | Resolution of the generated image. Optional values are 720P, 1080P, 2K, 4K, 1024x1024, 2048x2048, 2304x1728, 2496x1664, 2560x1440, 3024x1296, 4096x4096, 4694x3520, 4992x3328, 5404x3040, 6198x2656. When using the Jimeng model, it is recommended to specify the image resolution and aspect ratio through Prompt. Example value: 1024x1024 |
└ aspect_ratio | string | Optional | Specify the aspect ratio of the generated image. When ModelName is GEM, optional values are 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9; When ModelName is Qwen or Jimeng, it is not currently supported. Jimeng will intelligently determine the aspect ratio of the output image based on Prompt intent and reference image dimensions. Example value: 16:9 |
└ person_generation | string | Optional | Whether to allow generation of people or faces. Values: AllowAdult: Allow generation of adults; Disallowed: Prohibit people or faces in images; Example value: AllowAdult |
└ input_compliance_check | string | Optional | Whether to enable compliance check for input content. Values: Enabled: Enable; Disabled: Disable; Example value: Enabled |
└ output_compliance_check | string | Optional | Whether to enable compliance check for output content. Values: Enabled: Enable; Disabled: Disable; Example value: Enabled |
session_id | string | Optional | Identification code for deduplication. If a request with the same identification code has been made within three days, this request will return an error. Maximum 50 characters. Empty or no value means no deduplication. Example value: mysession |
session_context | string | Optional | Source context, used to pass through user request information. The audio and video quality regeneration completion callback will return this field value. Maximum 1000 characters. Example value: mySessionContext |
tasks_priority | string | Optional | Task priority. Higher values indicate higher priority. Range is -10 to 10. If not filled, it defaults to 0. Example value: 10 |
ext_info | string | Optional | Reserved field for special purposes. Example value: myextinfo |
Request Example
json
{
"model_name": "GEM",
"model_version": "3.0",
"file_infos": [
{
"type": "file",
"file_id": "387702299774574677",
"url": "",
"text": "Original image description."
}
],
"prompt": "Convert this image to anime style.",
"negative_prompt": "blur, distorted",
"enhance_prompt": "Enabled",
"output_config": {
"storage_mode": "Temporary",
"resolution": "1080P",
"aspect_ratio": "1:1",
"person_generation": "AllowAdult",
"input_compliance_check": "Enabled",
"output_compliance_check": "Enabled"
},
"session_id": "image-task-67890",
"session_context": "{\"user_id\":\"123\",\"scene\":\"profile_picture\"}",
"tasks_priority": 10,
"ext_info": ""
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/tencent-vod/v1/aigc-image' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model_name": "GEM",
"model_version": "3.0",
"file_infos": [
{
"type": "file",
"file_id": "387702299774574677",
"url": "",
"text": "Original image description."
}
],
"prompt": "Convert this image to anime style.",
"negative_prompt": "blur, distorted",
"enhance_prompt": "Enabled",
"output_config": {
"storage_mode": "Temporary",
"resolution": "1080P",
"aspect_ratio": "1:1",
"person_generation": "AllowAdult",
"input_compliance_check": "Enabled",
"output_compliance_check": "Enabled"
},
"session_id": "image-task-67890",
"session_context": "{\"user_id\":\"123\",\"scene\":\"profile_picture\"}",
"tasks_priority": 10,
"ext_info": ""
}'Response
🟢 200 Success
Response Body
| Parameter Name | Type | Required | Description |
|---|---|---|---|
status | string | Required | |
request_id | string | Required | |
response_url | string | Required | |
status_url | string | Required | |
cancel_url | string | Required | |
logs | null | Required | |
metrics | object | Required | |
queue_position | integer | Required |
Response Example
json
{
"Response": {
"TaskId": "251007502-AigcImage***2782aff1e896673f1ft",
"RequestId": "f50d7667-72d8-46bb-a7e3-0613588971b6"
}
}