cURL
curl https://api.apipod.ai/v1/videos/generations \
-H "Authorization: Bearer $APIPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}'import os
import requests
payload = {
"model": "kling-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}`)
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
});
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}),
});
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 4.0
Kling 4.0 Text to Video
Kling 4.0 T2V is APIPod’s text-to-video mode for Kling AI’s Kling 4.0, generating 3-30 second clips at 720p or 1080p with native audio from a single prompt.
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}'import os
import requests
payload = {
"model": "kling-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}`)
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
});
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-4.0-t2v",
"prompt": "Handheld long take at dusk: two old friends meet on a rainy London street and embrace as traffic hisses past.",
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "21:9"
}),
});
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"
}
}Usage notes
- Prompt only: send
prompt(required, up to 8,000 characters) with optionalduration(3-30 seconds),resolution(720por1080p) andaspect_ratio(16:9,9:16,1:1or21:9). Images and reference materials are not accepted; use Kling 4.0 Image to Video or Kling 4.0 Reference to Video. - Audio: every clip includes native audio generated together with the picture, so there is no
generate_audioparameter — sending it is rejected. - Not supported:
negative_prompt(write exclusions into the prompt),multi_shot/multi_prompt,mode, and 4K output.
Billing
Billed per second of output video. The per-second rate depends on the resolution (720p or 1080p). Current prices are shown on the model page.Task flow
The create call returnsdata.task_id. Poll Query video task until status is completed (outputs in data.result) or failed, or pass callback_url to be notified when the task reaches a terminal state.Authorizations
Use your APIPod API key as a Bearer token in the Authorization header.
Body
application/json
Public APIPod model ID.
Allowed value:
"kling-4.0-t2v"Required. Text description of the video, up to 8,000 characters. negative_prompt is not supported; describe exclusions in the prompt.
Required string length:
1 - 8000Output duration in seconds (3-30). Defaults to 5.
Required range:
3 <= x <= 30Output resolution. Defaults to 720p. 4K is not available for Kling 4.0.
Available options:
720p, 1080p Output aspect ratio. Defaults to 16:9.
Available options:
16:9, 9:16, 1:1, 21:9 HTTPS URL that receives the task's terminal state.
Was this page helpful?