# 文生音效-API接入

根据多样的提示词和模型进行AI音效生成

# 任务创建

根据输入参数创建算法任务并返回任务id

# 请求地址

/v3/pic/ttm/batch

# 请求参数

Method

post

Header

Field Required Type Value Description
Content-Type YES string application/json
Authorization YES string Basic xxxxxxxxx 用户使用appkey和secret拼接出来的Basic base64(appkey:appsecret)

Body

Field Son Field Required Type Value Description
text - YES string 提示词, 想在音效中出现的, 逗号分隔, 建议300个字以下

示例代码

{
  "text": "dog's bark"
}

# 返回数据

Body

Field Son Field Required Type Value Description
code - YES number 状态码, 490027:余额不足错误
msg - YES string 请求信息
data - YES object 响应数据
- task_id YES string 任务id

示例代码

{
  "code": 0,
  "msg": "",
  "data": {
    "task_id": "6a4eab77-be30-430a-bf0e-3048042a34ef"
  }
}

# 结果获取

根据任务id 请求任务处理结果

# 请求地址

/v3/pic/ttm/result/{task_id}

# 请求参数

Method

get

Header

Field Required Type Value Description
Content-Type YES string application/json
Authorization YES string Basic xxxxxxxxx 用户使用appkey和secret拼接出来的Basic base64(appkey:appsecret)

路径参数

Field Son Field Required Type Value Description
task_id - YES string 任务id

# 返回数据

Body

Field Son Field Required Type Value Description
code - YES number 状态码
msg - YES string 请求信息
data - YES object 响应数据
- status YES string 任务状态 状态:1- 等待中;2-进行中;3-任务完成;4-任务失败;5-任务关闭 6-任务超时 7-余额不足 8-内容敏感
- wait_time YES string 等待时间
- reason YES string 失败原因
- result YES string 结果url地址
最后更新时间: 7/27/2024, 6:59:47 PM