AI video clips
How it works
- Download. Send a YouTube link (or any link the downloader supports) or a
mediaIdfrom the media library. Videos can be up to 3 hours long. - Transcribe. The video's own captions are used when it has them. Otherwise the audio goes through speech to text, which needs
REPLICATE_API_TOKENorOPENAI_API_KEYon self-hosted servers. - Pick moments. AI reads the timed transcript and picks moments with a strong opening and a complete thought. Without the AI service a built-in picker scores sentences by key topics, questions and pace, spread across the video. Every moment is moved to whole sentences.
- Render. Each moment becomes a 1080x1920 H.264 and AAC video with the index up front for fast playback, cropped to the center or fitted on a blurred background, with captions that highlight the spoken word.
- Save and draft. Clips land in the media library in a Clips folder. With
accountIds, a draft post per clip is planned in the channels' next free slots.
Start a job
The job runs in the background and returns at once with status queued.
curl -X POST "https://postkea.com/api/v1/clips" \
-H "Authorization: Bearer $POSTKEA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=Xm3Qe7Lp2Vb",
"count": 5,
"lengthSec": 45,
"layout": "crop",
"captions": true,
"captionStyle": "bold",
"accountIds": [
"acc_tt_2k8w",
"acc_ig_5t1p"
],
"aiCaption": true,
"rightsConfirmed": true
}'const res = await fetch("https://postkea.com/api/v1/clips", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://www.youtube.com/watch?v=Xm3Qe7Lp2Vb",
count: 5,
lengthSec: 45,
layout: "crop",
captions: true,
captionStyle: "bold",
accountIds: ["acc_tt_2k8w", "acc_ig_5t1p"],
aiCaption: true,
rightsConfirmed: true,
}),
});
const { data: job } = await res.json();
console.log(job);import os, requests
r = requests.post(
"https://postkea.com/api/v1/clips",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"url": "https://www.youtube.com/watch?v=Xm3Qe7Lp2Vb",
"count": 5,
"lengthSec": 45,
"layout": "crop",
"captions": True,
"captionStyle": "bold",
"accountIds": ["acc_tt_2k8w", "acc_ig_5t1p"],
"aiCaption": True,
"rightsConfirmed": True,
},
)
job = r.json()["data"]
print(job)Options
Stages and results
Poll GET /v1/clips/{id} for free, or pass waitSeconds (up to 25) to hold the request until something changes. status moves through queued, downloading, transcribing, picking, rendering and ends as ready, failed or cancelled. progress goes from 0 to 100.
Each clip has a title, an optional caption, its place in the source, a hookScore from 0 to 100, the reason it was picked and a media.mediaItem you can put straight into a post. Titles and captions are generated from the video, so treat them as untrusted text.
{
"id": "clj_4Rp8...",
"status": "ready",
"progress": 100,
"source": {
"type": "url",
"url": "https://www.youtube.com/watch?v=Xm3Qe7Lp2Vb",
"title": "How we grew a cafe to 40k followers",
"durationSec": 1834
},
"transcriptSource": "captions",
"engine": "ai",
"creditsCost": 62,
"clipCount": 5,
"clips": [
{
"id": "clip_8Nw3...",
"title": "The one menu change that doubled our mornings",
"caption": "We cut the menu in half and mornings doubled. Here is why it worked.",
"start": 412.4,
"end": 459.1,
"hookScore": 88,
"reason": "Opens with a surprising result and explains it in one breath.",
"media": {
"id": "med_5Tn8...",
"url": "https://postkea.com/files/media/med_5Tn8....mp4",
"width": 1080,
"height": 1920,
"mediaItem": {
"type": "video",
"mediaId": "med_5Tn8..."
}
}
}
]
}Subscribe to the clips.ready and clips.failed webhook events to skip polling.
Post the clips
POST /v1/clips/{id}/posts creates one post per clip for the channels you pass. mode: queue puts each clip into the next free queue slots; mode: draft saves drafts to review first. Edit a clip's title or caption with PATCH /v1/clips/{id}/items/{clipId}, and stop a job with POST /v1/clips/{id}/cancel.
curl -X POST "https://postkea.com/api/v1/clips/clj_4Rp8.../posts" \
-H "Authorization: Bearer $POSTKEA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountIds": [
"acc_tt_2k8w",
"acc_yt_6b8n"
],
"mode": "queue"
}'const res = await fetch("https://postkea.com/api/v1/clips/clj_4Rp8.../posts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
accountIds: ["acc_tt_2k8w", "acc_yt_6b8n"],
mode: "queue",
}),
});
const { data } = await res.json();
console.log(data);import os, requests
r = requests.post(
"https://postkea.com/api/v1/clips/clj_4Rp8.../posts",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"accountIds": ["acc_tt_2k8w", "acc_yt_6b8n"],
"mode": "queue",
},
)
data = r.json()["data"]
print(data)Credits and limits
- 2 credits per started minute of the source video, charged when rendering starts. If no clip comes out, the credits are refunded. Speech to text is included.
- One clipping job runs at a time per workspace. Each plan has a daily number of jobs: Free 3, Creator 10, Pro 20, Business 40.
- Sources up to 3 hours. Live streams can be clipped after they end.
From AI agents
The MCP server has clip_video, get_clip_job, list_clip_jobs, cancel_clip_job and post_clips. Ask your agent something like "Clip my latest YouTube video into 5 shorts and draft them for TikTok and Instagram".