Uploads
On this page
How an upload works
Create
POST /v1/uploads with the name, type and size.
- Answers 201, status pending
- 413 if it is too big or storage is full
Send
PUT the whole file to upload_url.
- No key, within an hour
Complete
POST /v1/uploads/{upload_id}/complete
- Checks the size and the bytes, and measures the length
Use
Status ready: make a video, or add it to your workspace.
- Counts toward your storage until you delete it
Send a recording
The JavaScript and Python examples use BASE and auth as set up in the quickstart.
Create the upload
Send the file's name (up to 200 characters), its content type and its exact size in bytes. The content type must be the one its extension calls for, from the table below. Creating an upload takes no
Idempotency-Key.curl https://app.kinema.cc/v1/uploads \ -H "Authorization: Bearer $KINEMA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filename": "narration.mp3", "content_type": "audio/mpeg", "size": 9437184 }'import { stat } from "node:fs/promises"; const { size } = await stat("narration.mp3"); const upload = await fetch(`${BASE}/uploads`, { method: "POST", headers: { ...auth, "Content-Type": "application/json" }, body: JSON.stringify({ filename: "narration.mp3", content_type: "audio/mpeg", size }), }).then((r) => r.json());size = os.path.getsize("narration.mp3") upload = requests.post( f"{BASE}/uploads", headers=auth, json={"filename": "narration.mp3", "content_type": "audio/mpeg", "size": size}, ).json()Response{ "id": "8c1f4e2a9b7d4c0e9f3a6b2d1e8c7f05", "filename": "narration.mp3", "content_type": "audio/mpeg", "kind": "audio", "size": 9437184, "status": "pending", "duration_seconds": 0.0, "upload_url": "https://...", "expires_at": "2026-11-22T15:40:02.118Z" }Send the file
PUTthe whole file, in one request, toupload_urlbeforeexpires_at: you have an hour. Send no key with it; the address is the permission, and anAuthorizationheader can make storage turn it away.curl -X PUT --upload-file narration.mp3 "$UPLOAD_URL"import { readFile } from "node:fs/promises"; // reads the whole file into memory: for very large files, use curl or a client that streams const put = await fetch(upload.upload_url, { method: "PUT", body: await readFile("narration.mp3") }); if (!put.ok) throw new Error(`upload failed: ${put.status}`);with open("narration.mp3", "rb") as f: put = requests.put(upload["upload_url"], data=f) put.raise_for_status()Complete it
Tell Kinema the file is there. It checks that the stored file is the size you declared, that its contents really are what its extension says, and measures how long a recording is. The upload is then
ready.curl -X POST https://app.kinema.cc/v1/uploads/8c1f4e2a9b7d4c0e9f3a6b2d1e8c7f05/complete \ -H "Authorization: Bearer $KINEMA_API_KEY"const ready = await fetch(`${BASE}/uploads/${upload.id}/complete`, { method: "POST", headers: auth }) .then((r) => r.json()); console.log(ready.status, ready.duration_seconds); // ready 512.4ready = requests.post(f"{BASE}/uploads/{upload['id']}/complete", headers=auth).json() print(ready["status"], ready["duration_seconds"]) # ready 512.4Response{ "id": "8c1f4e2a9b7d4c0e9f3a6b2d1e8c7f05", "filename": "narration.mp3", "content_type": "audio/mpeg", "kind": "audio", "size": 9437184, "status": "ready", "duration_seconds": 512.4, "upload_url": null, "expires_at": null }Tip: Completing a large file takes a while
Keep the request open. If it is cut off, call complete again: while the first call is still checking the file the answer is
409upload_processing, and once the upload isreadyevery call answers with it at once.Make the video
Create the video with
upload_idin place ofscriptandvoice. An audio upload narrates the video; a video of yourself also puts you on camera. The video is as long as the recording, so with a live key it must run 6 to 40 minutes. More in Video workflows.video.json{ "title": "Apollo 11, in my own voice", "upload_id": "8c1f4e2a9b7d4c0e9f3a6b2d1e8c7f05", "maker": "standard", "music": true }
Files Kinema takes
| Extension | content_type | Kind |
|---|---|---|
.mp3 | audio/mpeg | audio |
.wav | audio/wav | audio |
.m4a | audio/mp4 | audio |
.aac | audio/aac | audio |
.mp4 | video/mp4 | video |
.mov | video/quicktime | video |
.m4v | video/x-m4v | video |
.webm | video/webm | video |
.jpg | image/jpeg | image |
.jpeg | image/jpeg | image |
.png | image/png | image |
.webp | image/webp | image |
.gif | image/gif | image |
Any other extension, or a content type that does not match it, is refused with unsupported_media. The file itself is checked when you complete it, so a renamed file does not get through. A video can be made only from an audio or a video upload.
What an upload can become
A ready upload
In this workspace and mode.
A video
- POST /v1/videos with upload_id
- Audio narrates; a video of you is on camera
A voice or an avatar
- POST /v1/voices or /v1/avatars
- With the person's permission
- Then use its id in a video
A library file
- POST /v1/library with a kind
- Music, a sound effect, an overlay or a clip
- Found in the editor, or used in clips
These calls need assets:write and an Idempotency-Key, and each kind takes only some files:
| Call | Takes | Becomes |
|---|---|---|
POST /v1/voices | Audio or video, up to 25 MB, with the speaker's permission | A cloned voice, for voice.id |
POST /v1/avatars | A JPG or PNG photo, up to 20 MB, with the person's permission | An avatar, for avatar.id |
POST /v1/library, music or sound_effect | MP3, WAV, M4A or AAC, up to 100 MB | Music or a sound effect in the editor's Audio tool |
POST /v1/library, overlay | A PNG, WebP or JPG picture, or an MP4, WebM or MOV clip | An overlay in the editor |
POST /v1/library, clip | A video | One of your own clips, for clips in a video |
A file over its limit is refused with 413 upload_too_large, and a file of the wrong kind with 422. A voice or an avatar of a real person needs that person's agreement: send consent as the JSON value true once you have shown them the sentence and they agreed to it. Anything else is refused.
| For | The sentence the person agrees to |
|---|---|
| A voice | "This is my voice, or I have the speaker's permission to clone it." |
| An avatar | "This is me, or this person has agreed to have their face and likeness used in AI-generated video." |
curl https://app.kinema.cc/v1/voices \
-H "Authorization: Bearer $KINEMA_API_KEY" \
-H "Idempotency-Key: voice-harbor-narrator" \
-H "Content-Type: application/json" \
-d '{
"upload_id": "3f4226e7c59b487499c4992f9ed2cf9b",
"name": "Harbor narrator",
"consent": true
}'{
"voice_id": "test_de6f37b31c5048468294ce377f584a3f",
"name": "Harbor narrator"
}With a test key nothing is made: the answer is a stand-in that joins the key's own voice or avatar list, for use in test requests.
Size and storage
| Limit | Value |
|---|---|
| Largest file | 4 GB (4,294,967,296 bytes) |
| File name | Up to 200 characters |
| Upload address | Works for 1 hour |
| Storage | Every upload counts toward your workspace's storage until you delete it |
| A video from a recording | As long as the recording: 6 to 40 minutes with a live key |
A bigger file is refused with upload_too_large. If the workspace has no room left, creating the upload is refused with storage_full: delete uploads you no longer need, or free space in the app. Each plan's storage is on Plans and credits.
With a test key
Nothing is stored. Creating the upload gives no upload_url, so there is nothing to send, and completing it makes it ready at once; an audio or video upload is then taken as 600 seconds long. The name, the content type and the size limit are checked as they are live, so you can build the whole flow before you go live.
List and delete
GET /v1/uploads lists your uploads in this mode, 20 to a page (up to 100 with limit), with cursor and next_cursor as for videos. They are not in date order; keep the ids you need on your side.
DELETE /v1/uploads/{upload_id} removes the upload and its file, and answers 204. It is refused with 409 upload_in_use while any API video of the workspace in that mode is still active, or while the upload is being completed, because a video may still need it. Each video keeps its own copy of the recording, so once your videos are made the upload can go.
Warning: A create sent twice makes two uploads
Creating an upload takes no Idempotency-Key. If a create times out, list your uploads before you try again, and delete any you do not need: each one counts toward your storage.
When an upload goes wrong
| Code | What happened | What to do |
|---|---|---|
422 unsupported_media | The extension is not one of the above, or the content type does not match it. | Fix the name or the content type and create the upload again. |
413 upload_too_large | The file is over 4 GB, or over what a voice, an avatar or a library file allows. | Send a smaller file. |
413 storage_full | The workspace has no room for it. | Delete files, then try again. |
422 size_mismatch | The stored file is not the size you declared, or it never arrived. | Send the file again while the address works, then complete it. |
400 invalid_request | The file's contents are not what its extension says. | Delete the upload and start again with a good file. |
422 invalid_request | The length of the recording could not be read. | Export the file again, then start a new upload. |
409 upload_processing | Another request is completing this upload right now. | Wait, then complete it again: a ready upload answers at once. |
409 upload_in_use | A delete while videos are active. | Delete it once your videos are done. |
503 storage_unavailable, upload_unavailable | Storage could not be reached. | Try again in a little while. |
More on Errors and retries.
Need a hand?
Ask on Discord, or write to hello@kinema.cc.