> ## 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}` | 讀取任務狀態和結果 |

隨每個請求發送 `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-hant/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，影片長度需為 4–360 秒，格式為 MP4 或 MOV。此欄位為影片旁白和影片配音模式的必填項目。

**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`。繼續輪詢 whilst `data.state` 是 `processing`。閱讀結果在 `success`，或閱讀 `failCode` 與 `failMsg` 在 `failed`。

```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-hant/guides/mcp-model-contracts.md)。


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