Build on kwirk 1.0
Our own video model in your product: videos from text and images, videos that follow a clip, anyone in today's trending videos, and swaps in your own clips.
From $0.049 per second at 1080p. Pay as you go, no plan.
Get your API keyAll docs as one text file for your AI assistant
Prices
Per second of finished video, whole seconds. A character from a photo is $0.30. Failed videos are refunded.
Quickstart
- Sign in on kwirk.ai (creator mode) and make a key here. You see it once.
- Top up your balance by card, from $5.
- Start a video, then poll it or wait for the webhook.
curl https://kwirk.ai/v1/videos \
-H "Authorization: Bearer kw_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1234" \
-d '{
"mode": "trend",
"trend_id": "9bed1594db40",
"characters": [{"photo_url": "https://example.com/mia.jpg"}],
"resolution": "1080p",
"webhook_url": "https://example.com/kwirk",
"metadata": {"order": "1234"}
}'Answer (201):
{
"id": "175a65b8c09b",
"object": "video",
"status": "queued",
"mode": "trend",
"seconds": 10,
"resolution": "1080p",
"price_usd": 0.5,
"progress": 0,
"video_url": null,
"error": null,
"metadata": {"order": "1234"}
}GET /v1/videos/{id} once it is done:
{
"id": "175a65b8c09b",
"object": "video",
"status": "succeeded",
"progress": 100,
"video_url": "https://…/final.mp4?…",
"price_usd": 0.5,
...
}API docs
Authentication
Send Authorization: Bearer kw_live_… with every request, from your server only. JSON in, JSON out. A deleted key stops working at once.
Send an Idempotency-Key header with POST /v1/videos: the same key never starts or charges a second video.
Endpoints
GET/v1/accountBalance, videos at once, running, prices.GET/v1/trendsToday's trends: q, limit (≤ 100), cursor.GET/v1/trends/{id}One trend.POST/v1/charactersA new character: photo_url or image (base64), more_photo_urls = up to 3 more photos of the same person (all go into one sheet), with sheet: true the picture as it is (any photo, or your own sheet in any layout), no new sheet drawn; or without a photo surprise (realistic | crazy) or description + style. name, external_user_id, metadata, webhook_url optional.GET/v1/charactersYour characters, newest first: limit (≤ 100), cursor, external_user_id, source api | app | all. Their ids go into characters.GET/v1/characters/{id}processing | ready | failed, with image_url and versions.POST/v1/characters/{id}/editChange the character: change in plain words and/or style realistic | crazy. A new version is drawn (the character price) and used from then on.POST/v1/characters/{id}/versions/{version_id}/useThat version is used in videos from now on. Free.DELETE/v1/characters/{id}Deletes the character, its sheets and its photos for good.POST/v1/characters/{id}/voice/find3 voices that fit the character (optional description), to listen to. Free.POST/v1/characters/{id}/voice/keepoption: that voice becomes the character's own voice, the same in every video.POST/v1/ideasSurprise me: one short video idea for characters (optional), look, language, avoid. $0.01, 3 an hour.POST/v1/videosMake a video (see the modes below).GET/v1/videos/{id}queued | running | succeeded | failed, progress, video_url.GET/v1/videosYour videos, newest first: limit, cursor, external_user_id, status.DELETE/v1/videos/{id}Deletes the video for good (once it is done or failed).POST/v1/photosMake a photo: prompt, character (an id, or a photo), characters (more ids), images [{url, use: pose | outfit | hair | shoes | place | person}], aspect_ratio, resolution 1K | 2K, look phone | amateur | pro | auto, exact, profile_picture.GET/v1/photos/{id}queued | running | succeeded | failed, image_url.GET/v1/photosYour photos, newest first: limit, cursor, external_user_id, status.DELETE/v1/photos/{id}Deletes the photo for good.DELETE/v1/end-users/{external_user_id}Deletes everything made for one of your users: characters, videos and photos.POST /v1/videos: modes
imagineprompt (+ characters, image_urls, audio_urls up to 5 sound files, video_url one video (then priced like reference), seconds 5–60, aspect_ratio 9:16 | 3:4 | 1:1 | 4:5 | 16:9, look real | cinematic | exact, voice default | own | similar), or surprise true instead of prompt: we write the idea from your characters and imagestrendtrend_id + characters (+ prompt for anything else)referencevideo_url + prompt (+ characters, image_urls, audio_urls, reference_use motion | inspiration | edit | extend, look, voice)swapvideo_url + characters (+ others change | keep)editvideo_id + prompt: what to change in one of your videos (it keeps its length and format)extendvideo_id + prompt + seconds: what happens next, up to 60 s for the whole video. The video's characters stay in unless you send charactersImagine and Reference turn your prompt into a full video script by themselves (kwirk Imagine), with look real (phone look, the default) or cinematic. look exact sends your prompt word for word.
voice (Imagine and Reference): own = characters with a saved voice speak in it, the others get a similar voice; similar = every voice is made with the video; default = own when one of your characters has a saved voice. Songs always keep a similar voice. Trends and swaps keep the clip's sound.
Every mode: resolution 1080p | 4K, webhook_url, metadata (your own JSON, sent back). characters: ids from POST /v1/characters, or {"photo_url": …} to make one on the way. In a prompt, call them by first name (@Mia) or @Character1, @Character2 …, and your files @Image1 …, @Audio1 …, @Video1.
ai_label: true (default) = the file carries only the tag kwirk AI; false = a completely clean file without any metadata.
A photo in characters becomes a character sheet first (best results, the character's price once, ready to use again). With "as_is": true the photo goes in as it is: free, but a sheet works better.
Serving your own users
Building kwirk into your own app? Send external_user_id (your id of the user, up to 128 characters) with every character, video and photo. Then list one user's things with ?external_user_id=, and when a user leaves, DELETE /v1/end-users/{external_user_id} removes everything made for them.
Everything made through the API stays out of your kwirk Library: you find it on this page under Made with the API. Links in video_url and image_url are signed and run out after a day: ask GET again for a fresh one, or copy the file to your own storage.
Webhooks: video.succeeded, video.failed, photo.succeeded, photo.failed, character.ready, character.failed. Need more videos at once for many users? Write to us.
Trends
New trends every day. List them, pick one, put your characters in. A trend video is as long as the trend (at most 30 seconds).
curl "https://kwirk.ai/v1/trends?q=dance&limit=20" -H "Authorization: Bearer kw_live_..."
{
"object": "list",
"data": [{
"id": "9bed1594db40",
"object": "trend",
"title": "Dog fronts the dance duo",
"seconds": 10.0,
"people": 2,
"tags": ["dance", "pets"],
"preview_url": "https://kwirk.ai/api/trends/9bed1594db40/files/preview.mp4",
"price_usd": 0.5
}],
"next_cursor": "20"
}Characters
Make a character once from a photo and use it in every video: it looks the same each time. It is ready in a minute or two; a video started meanwhile waits for it.
curl https://kwirk.ai/v1/characters -H "Authorization: Bearer kw_live_..." \
-H "Content-Type: application/json" \
-d '{"photo_url": "https://example.com/mia.jpg", "name": "Mia"}'
{"id": "a1b2c3d4e5f6", "object": "character", "status": "processing", "name": "Mia", "price_usd": 0.25}Webhooks
Set a URL here or send webhook_url with a video. When it is done we POST video.succeeded or video.failed, signed with your secret: Kwirk-Signature: t=<unix time>,v1=<hex>, where hex = HMAC-SHA256(secret, t + "." + body). Answer 2xx; we try three times.
POST https://example.com/kwirk
Kwirk-Signature: t=1764252000,v1=5f0c…
{"event": "video.succeeded", "created": 1764252000, "data": { …the video, as GET /v1/videos/{id} … }}Node.js
import crypto from "node:crypto";
// raw = the request body exactly as received (a string), header = req.headers["kwirk-signature"]
export function verify(raw, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = crypto.createHmac("sha256", secret).update(`${parts.t}.${raw}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}Python
import hashlib, hmac, time
def verify(raw: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(expected, parts["v1"])Errors
{"error": {"code": "insufficient_balance", "message": "Your balance is too low for this ($0.49)."}}400invalid_requestA field is missing or wrong; the message says which.401missing_key / invalid_keyNo key, or a deleted one.402insufficient_balanceTop up your balance. Nothing was started.403family_modeThe account is in family mode.404not_foundNo such trend, character or video on your account.422content_refusedThe words or files break the content rules (also famous people and children).422permission_requiredA file came without the permission statement.422voice_requiredvoice own, but none of the characters has a saved voice.429too_many_runningAll your videos at once are busy. Retry after Retry-After seconds.429rate_limitedMore than 300 requests a minute on one key.A video that doesn't work out ends as failed with a reason, and its price goes back to your balance.
Limits
1 video at once to start, 3 at once in a month in which you have topped up $100, more on request: write to us. Clips up to 30 seconds and 200 MB, photos up to 10 MB, up to 6 people in a trend or clip video (10 in imagine; from 4 people a video takes a few minutes longer).
20 at once in every calendar month in which you top up $1,000 (it starts again on the 1st, UTC).
Your files
With your first key you confirm once that every photo and video you send is yours, or that you have permission to use it, also from the people in it. Content rules · Terms