docs: add music, TTS, ASR API endpoints to customer-facing documentation

- POST /v1/music/generations: MiniMax Music 2.6/2.5 with lyrics structure tags
- POST /v1/audio/speech: MiniMax Speech 2.6 Turbo/HD, 2.5 HD, F5-TTS
- POST /v1/audio/transcriptions: qwen3-asr-flash, Nvidia parakeet-tdt-0.6b-v2
- Includes curl examples, response formats, model lists, error codes
This commit is contained in:
yumoqing 2026-06-04 14:07:00 +08:00
parent 23816650ab
commit 677ebae525

View File

@ -753,6 +753,249 @@ curl -X POST 'https://token.opencomputing.cn/llmage/v1/image/generations' \
---
## POST /v1/music/generations
音乐生成接口。
### 必填参数
| 参数 | 类型 | 说明 |
|------|------|------|
| `model` | string | 模型名称,如 `"music-2.6"`, `"music-2.5"` |
| `catelogid` | string | 目录类型ID固定为 `"music_gen"` |
| `prompt` | string | 音乐风格描述(风格、情绪、场景),如 `"流行音乐, 开心, 适合阳光明媚的下午"` |
| `lyrics` | string | 歌词内容,使用 `\n` 分隔每行,可包含结构标签 |
### 歌词结构标签
歌词中可包含以下结构标签来优化生成的音乐结构:
- `[Intro]` - 前奏
- `[Verse]` - 主歌
- `[Pre Chorus]` - 预副歌
- `[Chorus]` - 副歌
- `[Bridge]` - 桥段
- `[Outro]` - 尾声
- `[Interlude]` - 间奏
- `[Hook]` - 记忆点
- `[Build Up]` - 情绪铺垫
- `[Solo]` - 独奏
### 请求示例
```json
{
"model": "music-2.6",
"catelogid": "music_gen",
"prompt": "Pop music, happy, suitable for a sunny day",
"lyrics": "[Intro]\n\n[Verse]\nWalking down the street\nFeeling the beat\n\n[Chorus]\nDancing in the sun\nHaving so much fun"
}
```
```bash
curl -X POST 'https://token.opencomputing.cn/llmage/v1/music/generations' \
-H 'Authorization: Bearer ***
-H 'Content-Type: application/json' \
-d '{
"model": "music-2.6",
"catelogid": "music_gen",
"prompt": "流行音乐, 欢快, 适合阳光明媚的下午",
"lyrics": "[Intro]\n\n[Verse]\n走在阳光下\n感受每一刻\n\n[Chorus]\n在阳光下跳舞\n享受美好时光"
}'
```
### 响应格式
MiniMax 音乐生成为同步接口直接返回音频URL
```json
{
"id": "luid_xxx",
"object": "music.generation",
"model": "music-2.6",
"status": "SUCCEEDED",
"audio": "https://...",
"created": 1716912000
}
```
### 可用模型
| 模型名称 | model 参数 | 说明 |
|---------|-----------|------|
| MiniMax Music 2.6 | `music-2.6` | 最新版本,音质最佳 |
| MiniMax Music 2.5 | `music-2.5` | 支持14种段落级结构标签物理级高保真 |
### MiniMax Music 2.5 特性
Music 2.5 在「段落级强控制」与「物理级高保真」两大技术难题上实现突破:
- 开放全段落标签控制精准支持14种结构变体
- 长度限制:歌词内容 [1, 3500] 个字符
- prompt 长度限制:[10, 300] 个字符
### 错误响应
| 状态码 | 说明 |
|--------|------|
| 400 | 缺少必填参数或模型不存在 |
| 403 | 未登录 |
| 429 | 账户余额不足 |
---
## POST /v1/audio/speech
文本转语音TTS接口。
### 必填参数
| 参数 | 类型 | 说明 |
|------|------|------|
| `model` | string | 模型名称,如 `"speech-2.6-turbo"`, `"speech-2.6-hd"` |
| `catelogid` | string | 目录类型ID固定为 `"tts"` |
| `prompt` | string | 需要合成的文本内容,最长 10,000 字符 |
### 可选参数
| 参数 | 类型 | 说明 |
|------|------|------|
| `speaker` | string | 说话人/音色ID`"female-tianmei"` |
| `speed` | float | 语速,默认 `1.0` |
| `emotion` | string | 情感,如 `"happy"`, `"sad"` |
| `transno` | string | 交易流水号 |
### 请求示例
```json
{
"model": "speech-2.6-turbo",
"catelogid": "tts",
"prompt": "你好,欢迎使用语音合成服务",
"speaker": "female-tianmei",
"speed": 1.0,
"emotion": "happy"
}
```
```bash
curl -X POST 'https://token.opencomputing.cn/llmage/v1/audio/speech' \
-H 'Authorization: Bearer ***
-H 'Content-Type: application/json' \
-d '{
"model": "speech-2.6-turbo",
"catelogid": "tts",
"prompt": "你好,欢迎使用语音合成服务",
"speaker": "female-tianmei",
"speed": 1.0,
"emotion": "happy"
}'
```
### 响应格式
MiniMax TTS 为流式接口逐块返回音频数据hex编码自动转base64
```json
{
"status": "SUCCEEDED",
"audio": "base64_encoded_audio_data"
}
```
### 可用模型
| 模型名称 | model 参数 | 说明 |
|---------|-----------|------|
| MiniMax Speech 2.6 Turbo | `speech-2.6-turbo` | 极速版,更快更优惠,适用于语音聊天和数字人 |
| MiniMax Speech 2.6 HD | `speech-2.6-hd` | 高清版,超低延时,更高自然度 |
| MiniMax Speech 2.5 HD | `speech-2.5-hd-preview` | Preview版本 |
| F5-TTS 本地 | `f5tts` | 本地部署,零样本声音克隆,多语言支持 |
### 错误响应
| 状态码 | 说明 |
|--------|------|
| 400 | 缺少必填参数或模型不存在 |
| 403 | 未登录 |
| 429 | 账户余额不足 |
---
## POST /v1/audio/transcriptions
语音识别ASR接口将音频转为文本。
### 必填参数
| 参数 | 类型 | 说明 |
|------|------|------|
| `model` | string | 模型名称,如 `"qwen3-asr-flash"`, `"parakeet-tdt-0.6b-v2"` |
| `catelogid` | string | 目录类型ID固定为 `"asr"` |
| `audio_file` | string | 音频文件URL |
### 可选参数
| 参数 | 类型 | 说明 |
|------|------|------|
| `language` | string | 语言代码(部分模型支持) |
| `transno` | string | 交易流水号 |
### 请求示例
```json
{
"model": "qwen3-asr-flash",
"catelogid": "asr",
"audio_file": "https://example.com/audio.wav"
}
```
```bash
curl -X POST 'https://token.opencomputing.cn/llmage/v1/audio/transcriptions' \
-H 'Authorization: Bearer ***
-H 'Content-Type: application/json' \
-d '{
"model": "qwen3-asr-flash",
"catelogid": "asr",
"audio_file": "https://example.com/audio.wav"
}'
```
### 响应格式
```json
{
"text": "识别出的文本内容",
"usage": {
"duration_seconds": 5.2
}
}
```
### 可用模型
| 模型名称 | model 参数 | 说明 |
|---------|-----------|------|
| 通义千问 ASR | `qwen3-asr-flash` | 多语种识别、歌唱识别、情感识别、噪声拒识0.00026元/秒 |
| Nvidia ASR | `parakeet-tdt-0.6b-v2` | 仅支持英文6亿参数支持标点/大小写/时间戳 |
### 通义千问 ASR 核心功能
- 多语种识别:涵盖普通话及多种方言(粤语、四川话等)
- 复杂环境适应:自动语种检测与智能非人声过滤
- 歌唱识别伴随BGM下也能实现整首歌曲转写
- 上下文增强:通过配置上下文提高识别准确率
- 情感识别:支持惊讶、平静、愉快、悲伤、厌恶、愤怒、恐惧
### 错误响应
| 状态码 | 说明 |
|--------|------|
| 400 | 缺少必填参数或模型不存在 |
| 403 | 未登录 |
| 429 | 账户余额不足 |
---
## GET /v1/tasks
查询异步任务状态(仅用于视频生成等异步任务)。