cURL
curl https://api.apipod.ai/v1/videos/generations \
-H "Authorization: Bearer $APIPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
}'import os
import requests
payload = {
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": False
}
response = requests.post(
"https://api.apipod.ai/v1/videos/generations",
headers={
"Authorization": f"Bearer {os.environ['APIPOD_API_KEY']}",
"Content-Type": "application/json",
},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
}`)
req, err := http.NewRequest(http.MethodPost, "https://api.apipod.ai/v1/videos/generations", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("APIPOD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}use reqwest::Client;
use serde_json::json;
use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let payload = json!({
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
});
let response = Client::new()
.post("https://api.apipod.ai/v1/videos/generations")
.bearer_auth(env::var("APIPOD_API_KEY")?)
.json(&payload)
.send()
.await?
.error_for_status()?;
println!("{}", response.text().await?);
Ok(())
}const response = await fetch("https://api.apipod.ai/v1/videos/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIPOD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
}),
});
if (!response.ok) {
throw new Error(`APIPod request failed: ${response.status} ${await response.text()}`);
}
console.log(await response.json());{
"code": 200,
"message": "success",
"data": {
"task_id": "vid_task_01JEXAMPLE"
}
}Kling 3.0
Kling 3.0 图生视频
Kling 3.0 I2V 是 APIPod 面向快手可灵 Kling 3.0 提供的首尾帧图生视频模式,支持多镜头分镜与可选原生音频。
POST
https://api.apipod.ai
/
v1
/
videos
/
generations
cURL
curl https://api.apipod.ai/v1/videos/generations \
-H "Authorization: Bearer $APIPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
}'import os
import requests
payload = {
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": False
}
response = requests.post(
"https://api.apipod.ai/v1/videos/generations",
headers={
"Authorization": f"Bearer {os.environ['APIPOD_API_KEY']}",
"Content-Type": "application/json",
},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
}`)
req, err := http.NewRequest(http.MethodPost, "https://api.apipod.ai/v1/videos/generations", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("APIPOD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}use reqwest::Client;
use serde_json::json;
use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let payload = json!({
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
});
let response = Client::new()
.post("https://api.apipod.ai/v1/videos/generations")
.bearer_auth(env::var("APIPOD_API_KEY")?)
.json(&payload)
.send()
.await?
.error_for_status()?;
println!("{}", response.text().await?);
Ok(())
}const response = await fetch("https://api.apipod.ai/v1/videos/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIPOD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "kling-3.0-i2v",
"prompt": "The camera slowly pushes in as the dancer spins and lands in the final pose.",
"image_urls": [
"https://cdn.example.com/first-frame.jpg",
"https://cdn.example.com/last-frame.jpg"
],
"duration": 5,
"resolution": "1080p",
"generate_audio": false
}),
});
if (!response.ok) {
throw new Error(`APIPod request failed: ${response.status} ${await response.text()}`);
}
console.log(await response.json());{
"code": 200,
"message": "success",
"data": {
"task_id": "vid_task_01JEXAMPLE"
}
}使用说明
- 首尾帧:
image_urls为必填项,需提供 1-2 张图片。multi_shot为 false 时,2 张图依次为首帧(image_urls[0])与尾帧(image_urls[1]),1 张图作为首帧;multi_shot为 true 时仅支持首帧。输出画幅跟随首帧。 - 多镜头:将
multi_shot设为true,并在multi_prompt中描述最多 5 个镜头({prompt, duration},每个 1-12 秒、最多 500 字)。镜头总时长不得超过duration;省略duration时取各镜头时长之和,此时prompt也可省略。 - 音频:
generate_audio单镜头默认false,多镜头默认true。 - 提示词:单镜头请求必填;多镜头模式下请把每个镜头的描述写进
multi_prompt。 - 不支持:
kling_elements、aspect_ratio(画幅跟随首帧)、negative_prompt(请把排除项写进 prompt)、顶层audio_urls、video_url。
计费
按输出视频时长逐秒计费。每秒费率分五档:720p / 1080p 各自区分是否开启原生音频,另有 4K 一档(有无音频同价)。具体价格以 模型页 展示为准。任务流程
创建请求返回data.task_id。使用查询视频任务轮询,直到 status 变为 completed(结果位于 data.result)或 failed;也可以传入 callback_url,在任务进入终态时接收通知。授权
在 Authorization 请求头中以 Bearer Token 形式传入 APIPod API Key。
请求体
application/json
APIPod 公开模型 ID。
Allowed value:
"kling-3.0-i2v"首尾帧图片(必填)。multi_shot 为 false 时,2 张图依次为首帧(下标 0)与尾帧(下标 1),1 张图作为首帧;multi_shot 为 true 时仅支持首帧。也接受 first_frame_image / last_frame_image。输出宽高比跟随首帧。
Required array length:
1 - 2 elements描述画面运动的文本提示词,最多 2500 字。未提供 multi_prompt 时必填。
Maximum string length:
2500输出时长(秒),3-15,默认 5;多镜头模式下省略时取各镜头时长之和。
必填范围:
3 <= x <= 15输出分辨率(最高 4K),默认 720p。每秒费率取决于分辨率;720p / 1080p 还区分是否开启原生音频。
可用选项:
720p, 1080p, 4k 是否生成原生音频(别名 audio)。单镜头默认 false,多镜头默认 true。
开启多镜头生成(兼容 multi_shots)。配合 multi_prompt 定义每个镜头。
多镜头分镜列表,最多 5 个镜头。每个镜头为 {prompt, duration},prompt 最多 500 字,时长 1-12 秒;总时长不得超过 duration。
Maximum array length:
5Show child attributes
Show child attributes
接收任务终态通知的 HTTPS 地址。
此页面对您有帮助吗?