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

# Runway API 概覽

> 選擇 Runway 圖片、影片或音訊模型及其 CometAPI 端點，然後擷取任務結果。

透過 CometAPI 使用 Runway 模型來產生圖片、建立或編輯影片、
產生語音和音效，或處理音訊。每個建立請求都會
傳回任務 `id`；請使用任務端點擷取狀態和輸出 URL。

## 選擇模型和端點

以下模型可透過這些 Runway 端點使用。每個
連結的參考文件都會說明其模型的參數。

| 任務 | 模型 ID | 端點 |
| - | - | - |
| 產生圖片 | `gen4_image`, `gen4_image_turbo` | [文字轉圖片](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/generate-an-image-from-text.md) |
| 為圖片製作動畫 | `gen4.5`, `gen4_turbo` | [圖片轉影片](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/runway-images-raw-video.md) |
| 根據文字產生影片 | `gen4.5` | [文字轉影片](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/generate-a-video-from-text.md) |
| 編輯影片 | `aleph2` | [影片轉影片](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/generate-a-video-from-a-video.md) |
| 根據表演為角色製作動畫 | `act_two` | [角色表演](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/control-a-character.md) |
| 提升影片解析度 | `magnific_video_upscaler_creative` | [影片升頻](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/upscale-a-video.md) |
| 產生音效 | `eleven_text_to_sound_v2`, `seed_audio` | [音效](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/generate-sound-effects.md) |
| 根據文字產生語音 | `eleven_multilingual_v2`, `eleven_v3`, `eleven_v4`, `seed_audio` | [文字轉語音](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/generate-speech-from-text.md) |
| 轉換聲音 | `eleven_multilingual_sts_v2` | [語音轉語音](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/convert-speech.md) |
| 將音訊配音為另一種語言 | `eleven_voice_dubbing` | [語音配音](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/dub-audio.md) |
| 從背景音訊中分離語音 | `eleven_voice_isolation` | [語音分離](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/isolate-voice.md) |

`gen4.5` 支援文字轉影片和圖片轉影片請求。
`gen4_turbo` 使用圖片轉影片請求。 `seed_audio` 具有不同的輸入
欄位，適用於音效和文字轉語音；請依照所選端點的
模型變體。

## 建立任務並擷取結果

**1. 選擇端點和模型**

選取上述任務，然後使用該模型專屬的請求結構描述和
該端點頁面上的範例。

**2. 傳送請求**

[在本機儲存您的 API 金鑰](https://apidoc.cometapi.com/zh-Hant/overview/quick-start.md#store-your-api-key-locally)
為 `$COMETAPI_KEY`，再執行範例。
將 JSON 傳送至 `https://api.cometapi.com/runwayml/v1`，後接
端點路徑。使用 `Authorization: Bearer <COMETAPI_KEY>` 進行驗證。

**3. 儲存任務 ID**

儲存傳回的 `id`，以用於任務擷取請求。

**4. 擷取輸出**

使用 [取得 Runway 任務](https://apidoc.cometapi.com/zh-Hant/api/video/runway/official-format/runway-to-get-task-details.md)
，並使用來自同一 CometAPI 帳戶的 API 金鑰。當 `status` 為
`SUCCEEDED`時，下載 `output` 中列出的資產並加以儲存。

對於媒體輸入，請使用可存取的 HTTPS URL，或使用
端點結構描述中所示的資料 URI 格式。當
範例要求來源影片或音訊檔案時，請將範例媒體 URL 替換為您自己的輸入內容。


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