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

# 可靈會說話的照片 API（Kling Talking Photo）

> Kling video generation 整合指南 - Ace Data Cloud

一鍵把**一張照片 + 一段音訊**變成一段「會說話的影片」。服務內部自動完成兩步：先用 image2video 讓照片動起來，再用 lip-sync 按音訊對嘴型。你只需呼叫**一次**。

* **介面地址**：`POST https://api.acedata.cloud/kling/talking-photo`
* **計費**：按時長，5 秒 **16.45 Credits**、10 秒 **30.45 Credits**(= image2video + lip-sync 合併價)

## 請求標頭

| 欄位 | 值 |
| - | - |
| `authorization` | `Bearer ${API_KEY}` |
| `content-type` | `application/json` |

## 請求參數

| 參數 | 類型 | 必填 | 預設 | 說明 |
| - | - | - | - | - |
| `image_url` | string | 是 | — | 人物照片的公開 URL，建議清晰正臉 |
| `audio_url` | string | 是 | — | 驅動音訊的公開 URL（.mp3/.wav/.m4a/.aac,≤5MB） |
| `prompt` | string | 否 | — | 照片動畫化階段的動作/表情提示詞 |
| `model` | string | 否 | `kling-v2-1-master` | 照片動畫化使用的 Kling 模型 |
| `duration` | integer | 否 | `5` | 影片時長（5 或 10 秒） |
| `mode` | string | 否 | `pro` | 動畫化品質（std/pro） |
| `callback_url` | string | 否 | — | 傳入或 `async=true` 則非同步回傳 task\_id |
| `async` | boolean | 否 | `false` | 非同步模式，搭配 `/kling/tasks` 輪詢或回呼 |

## 請求範例

```bash theme={null}
curl -X POST 'https://api.acedata.cloud/kling/talking-photo' \
  -H 'authorization: Bearer ${API_KEY}' \
  -H 'content-type: application/json' \
  -d '{
    "image_url": "https://cdn.acedata.cloud/4hfydw.jpg",
    "audio_url": "https://cdn.acedata.cloud/6f7d62b18b.wav",
    "duration": 5
  }'
```

## 回應範例

```json theme={null}
{
  "success": true,
  "task_id": "0c0b4d3a-2f1e-4a6b-9c2d-2b3c4d5e6f70",
  "video_id": "895055968777281546",
  "video_url": "https://cdn.acedata.cloud/assets/examples/kling/6c68c267-065b-4423-b66b-a0e4c59ee0d5-6a664a591a53.mp4",
  "source_video_url": "https://cdn.acedata.cloud/assets/examples/gemini/04a043bd-6b23-4b4e-945c-ce48158c3eee-3a89912507c7.mp4",
  "duration": 5,
  "state": "succeed"
}
```

| 欄位 | 說明 |
| - | - |
| `video_url` | 最終會說話的影片（已轉存本平台 CDN） |
| `source_video_url` | 中間的照片動畫影片（image2video 結果） |
| `video_id` | 可靈影片 ID |

## 注意事項

* 照片建議清晰正臉、單人。
* 音訊時長建議不超過影片時長（5s/10s）。
* 計費在成功時發生；參數驗證失敗（4xx）不計費。
* 生成耗時約 4–6 分鐘（兩步），建議用 `async=true` + `/kling/tasks` 輪詢。


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