audiostring必須
The URL of the audio file.
kwaivgi/kling-video/ai-avatar/2.0/proKling AI Avatar 2.0 Pro by Kuaishou animates a portrait image into a talking-head video lip-synced to an input audio track, at Pro quality.
モデルを試す
PNG、JPEG、WebP、GIF · 最大 20 MiB
次に何をしますか?
例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
{
"audio": "https://static.sandbase.ai/examples/2344becd-9196-4cec-b002-593f3c58ad87/input/2cddcd9d-dc34-447a-b542-a333350592b9.mp3",
"image": "https://static.sandbase.ai/examples/2344becd-9196-4cec-b002-593f3c58ad87/input/fea5b189-ea59-4ce0-bc86-0b3ec493a3f8.jpg",
"prompt": "."
}Kling AI Avatar 2.0 Pro: a talking-head video from one portrait and an audio track, with lip sync and natural head motion.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | . | Gesture, expression, and scene direction. |
image | image URL, required | — | Portrait. JPEG, PNG, or WebP URL. |
audio | audio URL, required | — | Speech that drives the lips. |
$0.115 per output second; the output is as long as the audio. The quote before submission assumes 5 seconds.
| Audio | Price |
|---|---|
| 5s audio | $0.575 |
| 30s audio | $3.45 |
| 60s audio | $6.90 |
Failed runs are not charged.
Related: kwaivgi/kling-video/ai-avatar/2.0/standard.
開発を始める
このモデルをSandBase Unified Run API経由で送信します。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "kwaivgi/kling-video/ai-avatar/2.0/pro",
"audio": "https://static.sandbase.ai/examples/kwaivgi/kling-video/ai-avatar/2.0/pro/output_url_0.mp3",
"image": "https://static.sandbase.ai/examples/kwaivgi/kling-video/ai-avatar/2.0/pro/input_image_1.jpg",
"prompt": "."
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"SandBaseのAPIキーを作成し、サーバー環境に設定してください。すべてのリクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開したり、リポジトリにコミットしたりしないでください。
このモデルIDと入力を使って /v1/run にPOSTしてください。上のリクエスト例には送信とポーリングが含まれています。
返されたrun IDを使って、ステータスがcompleted、failed、timeoutになるまでポーリングしてください。出力はcompleted後にのみ読み取ってください。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"モデルのimage、video、またはaudioフィールドに、公開アクセス可能なファイルURLを指定してください。対応形式と制限は各Playground入力の横に表示されます。
Playgroundの対応する画像フィールドでアップロードまたは置換を使用してください。video URLフィールドはホストされたドライビング動画を受け付けますが、動画アップロード対応を意味するものではありません。
audiostring必須The URL of the audio file.
imagestring必須The URL of the image to use as your avatar
promptstring必須The prompt to use for the video generation.
デフォルト: "."
{
"model": "kwaivgi/kling-video/ai-avatar/2.0/pro",
"audio": "https://static.sandbase.ai/examples/kwaivgi/kling-video/ai-avatar/2.0/pro/output_url_0.mp3",
"image": "https://static.sandbase.ai/examples/kwaivgi/kling-video/ai-avatar/2.0/pro/input_image_1.jpg",
"prompt": "."
}完了したrunの結果は出力に表示されます。以下はモデルに保存されたサンプルであり、新規生成ではありません。
[
{
"poster": "https://static.sandbase.ai/examples/posters/b7ed3d27d2310471eedd.jpg",
"source": "Kling AI official schema mirror",
"source_url": "https://kling.ai/document-api/guides/get-started/overview",
"url": "https://static.sandbase.ai/examples/2344becd-9196-4cec-b002-593f3c58ad87/output/37839889-01c3-4a7d-aebf-a78913302b7a.mp4"
}
]