官方文档:https://platform.vidu.cn/docs/text-to-audio
POST
/ent/v2/text2audio创建文生音频任务
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/ent/v2/text2audio \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "audio1.0",
"prompt": "雨滴落在窗户上的声音,伴随着轻柔的雷声",
"duration": 5
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
Content-Type | Header | string | 否 | - | application/json |
model | JSON body | string | 是 | 模型名称可选值:audio1.0 | - |
prompt | JSON body | string | 是 | 文本提示词用于生成音频的描述。字符长度不能超过 1500 个字符 | - |
duration | JSON body | string | 否 | 音频时长默认 10,可选范围:2~10 秒内 | - |
seed | JSON body | string | 否 | 随机种子随机种子,若不传或传0则自动生成随机数,传固定值生成确定性结果 | - |
callback_url | JSON body | string | 否 | Callback 协议 需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致 回调返回的“status”包括以下状态: - processing 任务处理中 - success 任务完成(如发送失败,回调三次) - failed 任务失败(如发送失败,回调三次) Vidu采用回调签名算法进行认证,详情见:回调签名算法 | - |
返回响应 (200)
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
task_id | 响应 JSON | string | 是 | - | - |
state | 响应 JSON | string | 是 | - | - |
model | 响应 JSON | string | 是 | - | - |
prompt | 响应 JSON | string | 是 | - | - |
duration | 响应 JSON | integer | 是 | - | - |
seed | 响应 JSON | integer | 是 | - | - |
created_at | 响应 JSON | string | 是 | - | - |
credits | 响应 JSON | integer | 是 | - | - |
响应示例
{
"task_id": "911094612548939776",
"state": "created",
"model": "audio1.0",
"prompt": "雨滴落在窗户上的声音,伴随着轻柔的雷声",
"duration": 5,
"seed": 0,
"created_at": "2026-01-20T07:16:38.094635957Z",
"credits": 10
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 495899879,
"name": "创建文生音频任务",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档:https://platform.vidu.cn/docs/text-to-audio",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/ent/v2/text2audio",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "文本提示词用于生成音频的描述。字符长度不能超过 1500 个字符"
},
"model": {
"type": "string",
"description": "模型名称可选值:audio1.0"
},
"callback_url": {
"type": "string",
"description": "Callback 协议\n需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致\n回调返回的“status”包括以下状态:\n- processing 任务处理中\n- success 任务完成(如发送失败,回调三次)\n- failed 任务失败(如发送失败,回调三次)\nVidu采用回调签名算法进行认证,详情见:回调签名算法"
},
"duration": {
"type": "string",
"description": "音频时长默认 10,可选范围:2~10 秒内"
},
"seed": {
"type": "string",
"description": "\t随机种子随机种子,若不传或传0则自动生成随机数,传固定值生成确定性结果"
}
},
"required": [
"model",
"prompt"
],
"x-apifox-orders": [
"model",
"prompt",
"duration",
"seed",
"callback_url"
]
},
"examples": [
{
"mediaType": "application/json",
"value": "{\r\n \"model\": \"audio1.0\",\r\n \"prompt\": \"雨滴落在窗户上的声音,伴随着轻柔的雷声\",\r\n \"duration\": 5\r\n}"
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "Jsj23RwEo1",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
},
{
"id": "jjYSOg2NrR",
"name": "Content-Type",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {
"type": "inherit",
"inherit": {}
},
"responses": [
{
"id": 173662242,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {
"task_id": {
"type": "string"
},
"state": {
"type": "string"
},
"model": {
"type": "string"
},
"prompt": {
"type": "string"
},
"duration": {
"type": "integer"
},
"seed": {
"type": "integer"
},
"created_at": {
"type": "string"
},
"credits": {
"type": "integer"
}
},
"required": [
"task_id",
"state",
"model",
"prompt",
"duration",
"seed",
"created_at",
"credits"
],
"x-apifox-orders": [
"task_id",
"state",
"model",
"prompt",
"duration",
"seed",
"created_at",
"credits"
]
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "成功示例",
"responseId": 173662242,
"data": "{\r\n \"task_id\": \"911094612548939776\",\r\n \"state\": \"created\",\r\n \"model\": \"audio1.0\",\r\n \"prompt\": \"雨滴落在窗户上的声音,伴随着轻柔的雷声\",\r\n \"duration\": 5,\r\n \"seed\": 0,\r\n \"created_at\": \"2026-01-20T07:16:38.094635957Z\",\r\n \"credits\": 10\r\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fc09b-0b30-7549-bf4d-6e9d4b687660"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92436088,
"ordering": 18,
"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": ""
}