Skip to content

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 NameTypeRequiredDescriptionExample
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}
Content-TypestringOptionalapplication/json

Body Parameters (application/json)

Parameter NameTypeRequiredDescription
model_namestringRequiredModel name. Values: GEM: Gemini; Qwen: Qwen. Hunyuan: Hunyuan. Example value: GEM
model_versionstringRequiredModel 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
promptstringRequired
file_infosarray[object]Optional
  └ typestringOptionalInput video file type. Values: File: VOD media file; Url: Accessible URL; Example value: File
  └ file_idstringOptionalMedia 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
  └ urlstringOptionalAccessible 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
  └ textstringOptionalDescription 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_promptstringOptionalPrompt words to prevent the model from generating images.
enhance_promptstringOptionalWhether to automatically optimize the prompt. When enabled, the input Prompt will be automatically optimized to improve generation quality. Values: Enabled: Enable; Disabled: Disable;
output_configobjectOptionalOutput media file configuration for the image generation task.
  └ storage_modestringOptionalStorage 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
  └ resolutionstringOptionalResolution 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_ratiostringOptionalSpecify 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_generationstringOptionalWhether 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_checkstringOptionalWhether to enable compliance check for input content. Values: Enabled: Enable; Disabled: Disable; Example value: Enabled
  └ output_compliance_checkstringOptionalWhether to enable compliance check for output content. Values: Enabled: Enable; Disabled: Disable; Example value: Enabled
session_idstringOptionalIdentification 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_contextstringOptionalSource 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_prioritystringOptionalTask priority. Higher values indicate higher priority. Range is -10 to 10. If not filled, it defaults to 0. Example value: 10
ext_infostringOptionalReserved 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 NameTypeRequiredDescription
statusstringRequired
request_idstringRequired
response_urlstringRequired
status_urlstringRequired
cancel_urlstringRequired
logsnullRequired
metricsobjectRequired
queue_positionintegerRequired

Response Example

json
{
    "Response": {
        "TaskId": "251007502-AigcImage***2782aff1e896673f1ft",
        "RequestId": "f50d7667-72d8-46bb-a7e3-0613588971b6"
    }
}