POST https://api.tokenhot.cn/v1/chat/completionsmimo-v2.5-tts-voicecloneaudio.voice 字段传入,格式为 data:{MIME_TYPE};base64,{BASE64_AUDIO}。role: assistant 的消息中;role: user 的消息为可选的风格/语气指令。| 格式 | MIME_TYPE |
|---|---|
| MP3 | audio/mpeg 或 audio/mp3 |
| WAV | audio/wav |
curl --location 'https://api.tokenhot.cn/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "mimo-v2.5-tts-voiceclone",
"messages": [
{
"role": "user",
"content": ""
},
{
"role": "assistant",
"content": "Yes, I had a sandwich."
}
],
"audio": {
"format": "wav",
"voice": "data:audio/mpeg;base64,SUQz...(Base64 编码的音频样本)"
}
}'{
"id": "chatcmpl-abc123def456",
"object": "chat.completion",
"created": 1774324467,
"model": "mimo-v2.5-tts-voiceclone",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"audio": {
"id": "3864a4690d8a4aaea5f6acf4853a0600",
"data": "UklGR...(Base64 编码的音频数据)",
"expires_at": null,
"transcript": null
}
},
"finish_reason": "stop"
}
]
}