返回模型调用 API 参考
POST/kling/v1/images/generations

图像生成

API Key application/json

请求示例

curl -X POST https://top.qingyuntop.ai/kling/v1/images/generations \
  -H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v1",
    "prompt": "生成一张海边的图",
    "negative_prompt": "",
    "image": "",
    "image_reference": "",
    // "image_fidelity": "0.5",
    "human_fidelity": 0.45,
    "resolution": "1k",
    "n": 2,
    "aspect_ratio": "16:9",
    "callback_url": ""
}'

请求参数

参数位置类型必填说明示例
Content-TypeHeaderstring-application/json
AuthorizationHeaderstring-Bearer {{YOUR_API_KEY}}
model_name请求体string-kling-v1
prompt请求体string-生成一张海边的图
model_nameJSON bodystring模型名称 枚举值:kling-v1, kling-v1-5, kling-v2, kling-v2-new, kling-v2-1,kling-v3-
promptJSON bodystring正向文本提示词 不能超过2500个字符-
negative_promptJSON bodystring负向文本提示词 不能超过2500个字符-
imageJSON bodystring参考图像支持传入图片Base64编码或图片URL(确保可访问)-
image_referenceJSON bodystring图片参考类型 枚举值:subject(角色特征参考), face(人物长相参考) 使用face(人物长相参考)时,上传图片需仅含1张人脸。 使用 kling-v1-5 且 image 参数不为空时,当前参数必填-
image_fidelityJSON bodynumber生成过程中对用户上传图片的参考强度 取值范围:[0,1],数值越大参考强度越大-
human_fidelityJSON bodynumber面部参考强度,即参考图中人物五官相似度 仅 image_reference 参数为 subject 时生效 取值范围:[0,1],数值越大参考强度越大-
resolutionJSON bodystring生成图片的清晰度 枚举值:1k, 2k 1k:1K标清 2k:2K高清-
nJSON bodyinteger生成图片数量 取值范围:[1,9]-
aspect_ratioJSON bodystring生成图片的画面纵横比(宽:高) 枚举值:16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9-
callback_urlJSON bodystring--

返回响应 (200)

此部分没有定义参数。

来源原始接口定义(用于追溯)

以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。

{
  "id": 495899800,
  "name": "图像生成",
  "type": "http",
  "serverId": "",
  "preProcessors": [],
  "postProcessors": [],
  "inheritPreProcessors": {},
  "inheritPostProcessors": {},
  "description": "",
  "operationId": "",
  "sourceUrl": "",
  "method": "post",
  "path": "/kling/v1/images/generations",
  "tags": [],
  "status": -1,
  "requestBody": {
    "type": "application/json",
    "parameters": [
      {
        "id": "uxiCrq15Cj",
        "name": "model_name",
        "required": false,
        "enable": true,
        "description": "",
        "type": "string",
        "sampleValue": "kling-v1"
      },
      {
        "id": "Bp5PLaF0ag",
        "name": "prompt",
        "required": false,
        "enable": true,
        "description": "",
        "type": "string",
        "sampleValue": "生成一张海边的图"
      }
    ],
    "jsonSchema": {
      "type": "object",
      "properties": {
        "model_name": {
          "type": "string",
          "description": "模型名称 枚举值:kling-v1, kling-v1-5, kling-v2, kling-v2-new, kling-v2-1,kling-v3"
        },
        "prompt": {
          "type": "string",
          "description": "正向文本提示词 不能超过2500个字符"
        },
        "negative_prompt": {
          "type": "string",
          "description": "负向文本提示词 不能超过2500个字符"
        },
        "image": {
          "type": "string",
          "description": "参考图像支持传入图片Base64编码或图片URL(确保可访问)"
        },
        "image_reference": {
          "type": "string",
          "description": "图片参考类型\n枚举值:subject(角色特征参考), face(人物长相参考)\n使用face(人物长相参考)时,上传图片需仅含1张人脸。\n使用 kling-v1-5 且 image 参数不为空时,当前参数必填"
        },
        "image_fidelity": {
          "type": "number",
          "description": "生成过程中对用户上传图片的参考强度\n取值范围:[0,1],数值越大参考强度越大"
        },
        "human_fidelity": {
          "type": "number",
          "description": "面部参考强度,即参考图中人物五官相似度\n仅 image_reference 参数为 subject 时生效\n取值范围:[0,1],数值越大参考强度越大"
        },
        "resolution": {
          "type": "string",
          "description": "生成图片的清晰度\n枚举值:1k, 2k\n1k:1K标清\n2k:2K高清"
        },
        "n": {
          "type": "integer",
          "description": "生成图片数量\n取值范围:[1,9]"
        },
        "aspect_ratio": {
          "type": "string",
          "description": "生成图片的画面纵横比(宽:高)\n枚举值:16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9"
        },
        "callback_url": {
          "type": "string"
        }
      },
      "required": [
        "model_name",
        "prompt",
        "n"
      ],
      "x-apifox-orders": [
        "model_name",
        "prompt",
        "negative_prompt",
        "image",
        "image_reference",
        "image_fidelity",
        "human_fidelity",
        "resolution",
        "n",
        "aspect_ratio",
        "callback_url"
      ]
    },
    "examples": [
      {
        "mediaType": "application/json",
        "value": "{\r\n    \"model_name\": \"kling-v1\",\r\n    \"prompt\": \"生成一张海边的图\",\r\n    \"negative_prompt\": \"\",\r\n    \"image\": \"\",\r\n    \"image_reference\": \"\",\r\n    // \"image_fidelity\": \"0.5\",\r\n    \"human_fidelity\": 0.45,\r\n    \"resolution\": \"1k\",\r\n    \"n\": 2,\r\n    \"aspect_ratio\": \"16:9\",\r\n    \"callback_url\": \"\"\r\n}"
      }
    ],
    "mediaType": "",
    "oasExtensions": "",
    "required": true,
    "additionalContentTypes": []
  },
  "parameters": {
    "path": [],
    "query": [],
    "cookie": [],
    "header": [
      {
        "id": "KhVJoFPZ8L",
        "name": "Content-Type",
        "required": false,
        "enable": true,
        "description": "",
        "type": "string",
        "sampleValue": "application/json"
      },
      {
        "id": "z1jiVngvcv",
        "name": "Authorization",
        "required": false,
        "enable": true,
        "description": "",
        "type": "string",
        "sampleValue": "Bearer {{YOUR_API_KEY}}"
      }
    ]
  },
  "commonParameters": {
    "query": [],
    "body": [],
    "cookie": [],
    "header": []
  },
  "auth": {},
  "responses": [
    {
      "id": 181388568,
      "name": "成功",
      "code": 200,
      "contentType": "json",
      "jsonSchema": {
        "type": "object",
        "properties": {},
        "x-apifox-orders": []
      },
      "itemSchema": {},
      "description": "",
      "mediaType": "",
      "headers": []
    }
  ],
  "responseExamples": [],
  "codeSamples": [],
  "projectId": 8662722,
  "moduleId": 8310462,
  "folderId": 92436146,
  "ordering": 0,
  "responsibleId": 0,
  "commonResponseStatus": {},
  "advancedSettings": {
    "disabledSystemHeaders": {}
  },
  "customApiFields": {},
  "oasExtensions": "",
  "mockScript": {},
  "createdAt": "2026-08-02T03:53:34.000Z",
  "updatedAt": "2026-08-06T12:15:55.000Z",
  "creatorId": 2863449,
  "editorId": 2863449,
  "creatorUserId": 2863449,
  "editorUserId": 2863449,
  "responseChildren": [],
  "visibility": "INHERITED",
  "securityScheme": {},
  "callbacks": ""
}