Call it
curl https://api.peume.com/v1/call/text-to-video-4-0 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "your prompt",
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5
}
}'const res = await fetch("https://api.peume.com/v1/call/text-to-video-4-0", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"prompt": "your prompt",
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/text-to-video-4-0",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"prompt": "your prompt",
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: text-to-video-4-0.
Parameters
promptRequiredstringText prompt (positive and negative descriptions, max 26000 characters). Kling allows 26,000 English or 11,000 non-English characters (mixed text: English / 26,000 + other / 11,000 ≤ 1); only the 26,000 total is checked here, and a longer non-English prompt is rejected by Kling at no charge.
resolutionRequiredstringOutput resolution (720p | 1080p) — also the price selector.
720p · 1080p
aspect_ratiostringAspect ratio (width:height) of the output. Default 16:9.
21:9 · 16:9 · 9:16 · 1:1
Example: 16:9
durationintegerOutput duration in seconds (3-30). Default 5. Billed per second.
Example: 5
