> ## Documentation Index
> Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Seed Audio 1.5 API：音频生成与视频配音

> 使用 Seed Audio 1.5 API 可生成语音和场景音频、向视频添加声音、翻译并配音对话，或分离音轨。

## 概览

| 功能 | 值 |
| - | - |
| 模型 ID | `seed-audio-1-5` |
| 交付 | 异步轮询或 webhook 回调 |
| 输出 | WAV、MP3 或 Ogg Opus 音频、可选视频和可选字幕文件 |

| 模式 | 所需输入 | 其功能 |
| - | - | - |
| `audio-generation` | `prompt` | 创建语音或场景音频，以及可选的参考音频 |
| `video-voice-over` | `video_urls`, `prompt` | 添加由原始视频引导的旁白或声音 |
| `video-dubbing` | `video_urls`, `target_language` | 检测源语言并将对话配音为所选语言 |
| `audio-separation` | `audio_urls`, `prompt` | 提取语音、音乐和音效等曲目 |

## 接口与身份验证

API 基础地址：

```text theme={null}
https://api.apixo.ai/api/v1
```

| 方法 | 端点 | 用途 |
| - | - | - |
| `POST` | `/generateTask/seed-audio-1-5` | 提交音频任务 |
| `GET` | `/statusTask/seed-audio-1-5?taskId={taskId}` | Read取任务状态和结果 |

随每个请求发送 `Authorization: Bearer YOUR_API_KEY`。创建任务时发送 `Content-Type: application/json`。

## 请求示例

### 生成音频

```bash theme={null}
curl -X POST 'https://api.apixo.ai/api/v1/generateTask/seed-audio-1-5' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"mode":"audio-generation","prompt":"Say in a warm voice: \"Welcome to the studio.\""}}'
```

### 视频配音

```json theme={null}
{
  "input": {
    "mode": "video-voice-over",
    "video_urls": ["https://example.com/shoreline.mp4"],
    "prompt": "As the sea comes into view, say: \"This is where it begins.\" Add gentle waves.",
    "include_video": true
  }
}
```

### 配音视频并请求两个字幕集

```json theme={null}
{
  "input": {
    "mode": "video-dubbing",
    "video_urls": ["https://example.com/interview-zh.mp4"],
    "target_language": "en",
    "glossaries": [{"source": "星海计划", "target": "Project Starsea"}],
    "include_video": true,
    "include_subtitles": true,
    "include_source_subtitles": true
  }
}
```

使用 `include_video: false` 或省略它来接收配音音频和任何请求的字幕。

### 单独的音轨

```json theme={null}
{
  "input": {
    "mode": "audio-separation",
    "audio_urls": ["https://example.com/scene-mix.wav"],
    "prompt": "Separate the dialogue, background music, and sound effects."
  }
}
```

## 参数

**request\_type** `string` (default: async)

交货方式。支持的值：`async`、`callback`。

**callback\_url** `string`

当`request_type`为`callback`时需要。使用接收完成事件的公开 HTTPS URL。请参阅 [Webhooks](https://apixo.ai/docs/zh/api-reference/webhooks.md)。

**input** `object` *required*

Seed Audio 1.5 任务输入。

**属性**

**mode** `string` *required*

任务模式。支持的值：`audio-generation`、`video-voice-over`、`video-dubbing`、`audio-separation`。

**prompt** `string`

音频生成、视频旁白和音频分离所需。提供要说的话和任何场景说明，或描述要提取的曲目。视频配音模式下不填写。

**audio\_urls** `string[]`

公开 HTTP(S) 网址，用于 WAV 或 MP3 文件。音频生成和视频旁白可选择提供一到六个参考音频，每个参考音频长度为 2–30 秒。在提示中使用 `@audio1`、`@audio2` 等方式按顺序引用这些参考音频。音频分离需提供恰好一个音频文件，时长为 2–360 秒。

**video\_urls** `string[]`

提供恰好一个可公开访问的 HTTP(S) 视频 URL，视频文件格式为 MP4 或 MOV，时长为 4–360 秒。视频旁白和视频配音模式必填。

**format** `string` (default: wav)

音频下载格式。支持的值：`wav`、`mp3`、`ogg_opus`。

**sample\_rate** `integer`

音频采样率（以 Hz 为单位）。对于 `wav` 和 `mp3`，支持的值为 `8000`、`16000`、`24000`、`32000`、`44100` 和 `48000`，默认值为 `44100`。对于 `ogg_opus`，`48000` 是默认且唯一支持的采样率。省略此字段将使用所选格式的默认值。

**speech\_rate** `integer` (default: 0)

语速调整范围为 -50 至 100。适用于音频生成和视频画外音。

**loudness\_rate** `integer` (default: 0)

响度调整范围为 -50 至 100。适用于音频生成和视频画外音。

**pitch\_rate** `integer` (default: 0)

音高调节范围为 -12 至 12。适用于音频生成和视频画外音。

**target\_language** `string`

视频配音必需，包括提供自定义字幕时。系统将自动检测源语言。支持的语言代码：`zh`、`en`、`ja`、`ko`、`de`、`fr`、`pt-BR`、`th`、`id`、`vi`、`ms`、`fil`、`it`、`ru`、`nl`、`pl`、`tr`、`sv`、`es-ES`、`es-MX`、`ar`、`pt-PT`、`fi`、`da`、`no`、`cs`、`hu`、`el`、`ro`、`hi`。

**glossaries** `object[]`

视频配音的可选翻译偏好设置。每个条目包含一个非空的 `source` 语句和一个非空的 `target` 翻译。适用于术语、名称或品牌。与 `custom_subtitle_url` 互斥。

**custom\_subtitle\_url** `string`

可选的公开 HTTP(S) URL，指向一个 UTF-8 SRT 文件，用于视频配音的目标语言。每个段落最长为 15 秒。提供的 SRT 文件包含配音对话内容。与 `glossaries` 互斥。

**dialogue\_enhancement** `string` (default: off)

视频配音的对话增强级别。支持的值：`off`、`low`、`medium`、`high`。

**include\_video** `boolean` (default: false)

请求包含生成或配音音频的视频。适用于视频语音旁白和视频配音。

**include\_subtitles** `boolean` (default: false)

请求视频配音的目标语言 SRT 和 JSONL 字幕文件。

**include\_source\_subtitles** `boolean` (default: false)

请求视频配音的源语言 SRT 和 JSONL 字幕文件。

## 响应格式

保存提交响应中的 `data.taskId`。使用该 ID 进行轮询，或使用 `request_type: "callback"` 配合你的 `callback_url`。在 `data.state` 为 `processing` 时持续轮询。在 `success` 状态下读取结果，或在 `failed` 状态下读取 `failCode` 和 `failMsg`。

```bash theme={null}
curl 'https://api.apixo.ai/api/v1/statusTask/seed-audio-1-5?taskId=YOUR_TASK_ID' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

该成功的配音响应包含可选的视频和两个字幕集。

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "YOUR_TASK_ID",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/dubbed-audio.wav\",\"https://file.apixo.ai/dubbed-video.mp4\"]}",
    "final_duration": 8,
    "extraResults": {
      "target_language": "en",
      "subtitles": {
        "srt_url": "https://file.apixo.ai/target.srt",
        "jsonl_url": "https://file.apixo.ai/target.jsonl"
      },
      "source_subtitles": {
        "srt_url": "https://file.apixo.ai/source.srt",
        "jsonl_url": "https://file.apixo.ai/source.jsonl"
      }
    }
  }
}
```

| 成功字段 | 含义 |
| - | - |
| `data.resultJson` | 一个 JSON 字符串。解析一次即可读取 `resultUrls`。音频按曲目顺序显示，然后是可选视频。 |
| `data.final_duration` | 向上取整后的计费秒数。无法取得时长时省略此字段。 |
| `data.extraResults.target_language` | 为视频配音选择的目标语言。 |
| `data.extraResults.subtitles` | 返回时，目标语言字幕下载链接位于 `srt_url` 和 `jsonl_url` 中。 |
| `data.extraResults.source_subtitles` | 相同格式的源语言字幕下载链接。 |
| `data.extraResults.audio_tracks` | 返回时的音频分离标签。每个条目都有一个从零开始的 `result_index` 到 `resultUrls`，并且可以包含 `type` 和 `description`。 |

当没有附加结果时，`extraResults`被省略。成功的 Webhook 具有相同的结果字段。`createTime`、`completeTime` 和 `costTime` 等平台计时字段以毫秒为单位。使用 `final_duration` 计费秒数。

## 计费

| 场景 | 标准费率 |
| - | -: |
| `audio-generation`或`video-voice-over` | \$0.15 每分钟 |
| `video-dubbing`带音频输出 | \$0.60 每分钟 |
| `video-dubbing`带音视频输出 | \$0.90 每分钟 |
| `audio-separation` | \$0.05 每分钟 |

将 `final_duration` 除以 60 再乘以适用费率。例如，配音时长为 8 秒时，仅输出音频的费用为 \$0.08，同时输出音频和视频的费用为 \$0.12。音频分离会先汇总所有返回音轨的使用时长，再按整秒计费。在应用账户折扣后，请求总费用将向上取整至最接近的 \$0.001。当前费率详情请参见 [API 定价](https://apixo.ai/pricing/api)。

## MCP 集成

模型 Schema 在 `mcp.attachments` 中列出音频、视频和 SRT 字幕的附件字段，`mcp.result` 使用 `audio_artifacts_v1`。任务成功后，`get_generation` 会在 `download_urls` 中返回主要媒体文件的链接，并在有数据时返回 `final_duration` 和 `extraResults`。字幕分组提供 SRT 和 JSONL 下载链接。每个音轨标签都通过 `result_index` 指向 `download_urls` 中的对应条目。详见 [MCP 模型接口约定](https://apixo.ai/docs/zh/guides/mcp-model-contracts.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.