POST
/kling/v1/audio/text-to-audio文生音效
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/kling/v1/audio/text-to-audio \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "描述风景的音频",
"duration": 5.0,
"external_task_id": "",
"callback_url": ""
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Content-Type | Header | string | 否 | - | application/json |
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
prompt | JSON body | string | 是 | 文本提示词 | - |
duration | JSON body | string | 是 | 生成音频的时长取值范围: 3.0秒至10.0秒,支持小数点后一位精度 | - |
external_task_id | JSON body | string | 否 | - | - |
callback_url | JSON body | string | 否 | - | - |
返回响应 (200)
此部分没有定义参数。
来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 495899811,
"name": "文生音效",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/kling/v1/audio/text-to-audio",
"tags": [],
"status": -1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "文本提示词"
},
"duration": {
"type": "string",
"description": "生成音频的时长取值范围: 3.0秒至10.0秒,支持小数点后一位精度"
},
"external_task_id": {
"type": "string"
},
"callback_url": {
"type": "string"
}
},
"required": [
"prompt",
"duration"
],
"x-apifox-orders": [
"prompt",
"duration",
"external_task_id",
"callback_url"
]
},
"examples": [
{
"mediaType": "application/json",
"value": "{\r\n \"prompt\": \"描述风景的音频\",\r\n \"duration\": 5.0,\r\n \"external_task_id\": \"\",\r\n \"callback_url\": \"\"\r\n}"
}
],
"mediaType": "",
"oasExtensions": "",
"required": true,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "DxmmZyxFkf",
"name": "Content-Type",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
},
{
"id": "9w52vXw5kt",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 189936863,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": []
}
],
"responseExamples": [],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92436152,
"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": ""
}