跳转到主要内容
POST
/
api
/
open-api
/
v1
/
soundCloning
/
audios
SoundClone - 提交音频生成任务
curl --request POST \
  --url https://www.jimmyai.cn/api/open-api/v1/soundCloning/audios \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "modelId": "model_123456789",
  "contentText": "欢迎使用声音克隆能力,这是一段用于生成正式音频的文本。",
  "language": "Chinese",
  "soundVersion": "v1",
  "emotion": "neutral",
  "speed": 1,
  "vol": 1,
  "pitch": 0,
  "subtitleEnable": false
}
'
{
  "code": 20000,
  "msg": "ok",
  "data": {
    "id": "audio_764fb3e7-8af2-4d2d-89a0-e58f8f3eb9c4",
    "object": "audio",
    "created": 1781777280,
    "model": "soundCloningAudio",
    "status": "queued",
    "error": null
  }
}
使用 试听任务 完成后返回的 modelId 提交正式音频生成。任务创建后请通过 查询声音克隆任务 轮询获取 audioUrlmodelId 有效期为 3 天;在有效期内首次调用本接口时会自动转正,转正后可永久用于音频生成。响应格式:{ "code": 20000, "msg": "ok", "data": { ... } }

请求参数

字段类型必填说明
modelIdstring声音模型 ID,来自试听任务查询结果中的 modelId
contentTextstring需要生成音频的文本,长度小于 10000 字符。可在字间插入 <#x#> 控制停顿(x 为秒,范围 0.01–99.99,最多两位小数)。
soundVersionstring声音模型版本:v1v2
languagestring语言类型,默认 auto
emotionstring情感类型,默认 neutral。支持 happysadangryfearfuldisgustedsurprisedneutral
speednumber语速,范围 [0.5, 2],默认 1.0
volnumber音量,范围 (0, 10],默认 1.0
pitchinteger语调,范围 [-12, 12],默认 0
subtitleEnableboolean是否生成字幕,默认 false
subtitleTypestring字幕类型。开启字幕时可传 word(字级别);不传为句级别。

支持语言(节选)

v1 / v2 均支持: Chinese(中文)、Chinese,Yue(粤语)、EnglishJapaneseKoreanFrenchGermanSpanish 等 24 种语言。 仅 v2 支持: BulgarianDanishHebrewMalayPersianSwedishTamilauto(自动检测)等。

计费说明

正式音频包含两部分费用:
模型配置名说明
sound-cloning-audiocontentText 字符数计费,单位为每 1 万字符
sound-cloning-voice音色费:每次提交正式音频任务均收取(按次,与 modelId 无关)
字符数统计规则与试听一致:按 Unicode 字符计数,排除 <#x#> 停顿标记。

示例请求

curl --request POST \
  --url 'https://www.jimmyai.cn/api/open-api/v1/soundCloning/audios' \
  --header 'Authorization: Bearer sk_xxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "modelId": "model_123456789",
    "contentText": "欢迎使用声音克隆能力,这是一段用于生成正式音频的文本。",
    "language": "Chinese",
    "soundVersion": "v1",
    "emotion": "neutral",
    "speed": 1.0,
    "vol": 1.0,
    "pitch": 0,
    "subtitleEnable": false
  }'

响应示例

{
  "code": 20000,
  "msg": "ok",
  "data": {
    "id": "audio_764fb3e7-8af2-4d2d-89a0-e58f8f3eb9c4",
    "object": "audio",
    "created": 1781777280,
    "model": "soundCloningAudio",
    "status": "queued",
    "error": null
  }
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
modelId
string
必填

试听任务完成后返回的声音模型 ID

contentText
string
必填

生成音频的文本,小于 10000 字符

soundVersion
enum<string>
可用选项:
v1,
v2
language
string
默认值:auto
emotion
enum<string>
默认值:neutral
可用选项:
happy,
sad,
angry,
fearful,
disgusted,
surprised,
neutral
speed
number
默认值:1
必填范围: 0.5 <= x <= 2
vol
number
默认值:1
必填范围: x <= 10
pitch
integer
默认值:0
必填范围: -12 <= x <= 12
subtitleEnable
boolean
默认值:false
subtitleType
enum<string>

不传为句级别字幕

可用选项:
word

响应

200 - application/json

任务创建成功

code
integer
示例:

20000

msg
string
示例:

"ok"

data
object
示例:
{
"id": "audio_16b635ba-5889-4fa5-bbcc-bf67a38c353a",
"object": "audio",
"created": 1781777280,
"model": "soundCloningClone",
"status": "queued",
"error": null
}