Call it
curl https://api.peume.com/v1/call/generate-or-edit-video-4-0 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "your prompt",
"media": [],
"resolution": "720p",
"aspect_ratio": "adaptive",
"duration": 5,
"audio": "native"
}
}'const res = await fetch("https://api.peume.com/v1/call/generate-or-edit-video-4-0", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"prompt": "your prompt",
"media": [],
"resolution": "720p",
"aspect_ratio": "adaptive",
"duration": 5,
"audio": "native"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/generate-or-edit-video-4-0",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"prompt": "your prompt",
"media": [],
"resolution": "720p",
"aspect_ratio": "adaptive",
"duration": 5,
"audio": "native"
}
},
)
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: generate-or-edit-video-4-0.
Parameters
promptRequiredstringText prompt (max 26000 characters). Refer to media by the id you gave it (@image_1, @video_1) and say what each reference is for; for edits, state what to change and what to keep. 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.
mediaarrayReference material. Omit for pure text-to-video.
Example: []
resolutionRequiredstringOutput resolution (720p | 1080p) — also the price selector.
720p · 1080p
aspect_ratiostringAspect ratio of the output, or adaptive: follow the prompt, else the base video, the first frame, then the feature video (16:9 when none applies). Default adaptive.
21:9 · 16:9 · 9:16 · 1:1 · adaptive
Example: adaptive
durationintegerOutput duration in seconds (3-30). Default 5. Billed per second.
Example: 5
audiostringnative: generate synchronized audio. original: keep the input video's own sound (needs a feature_video or base_video; the base video's audio wins). Default native. No price impact.
native · original
Example: native
