Large uploads
When your media lives on local disk rather than a public HTTPS URL, upload it to temporary staging first and pass the returned inputUrl to POST /v1/jobs. The Splixir CLI handles this automatically and switches to multipart upload for files over 50 MiB. See Pricing and limits for tier file caps.
Single-part presigned uploads
Section titled “Single-part presigned uploads”Use POST /v1/uploads/presign for files up to 50 MiB. Splixir returns a uploadUrl (valid for 900 seconds), a temporary inputUrl (valid for 3600 seconds), and requiredHeaders (Content-Type and Content-Length).
# 1. Request presigned URLscurl -X POST https://api.splixir.com/v1/uploads/presign \ -H "Authorization: Bearer $SPLIXIR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"filename": "clip.mp4", "contentType": "video/mp4", "bytes": 12345678}'
# 2. Upload file bytes to uploadUrlcurl -X PUT "$UPLOAD_URL" \ -H "Content-Type: video/mp4" \ --data-binary @./clip.mp4
# 3. Submit job with inputUrlcurl -X POST https://api.splixir.com/v1/jobs \ -H "Authorization: Bearer $SPLIXIR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"kind\": \"video\", \"input\": \"$INPUT_URL\", \"operations\": [{\"type\": \"transcode\", \"codec\": \"h264\", \"container\": \"mp4\"}]}"import fs from "node:fs/promises";
const key = process.env.SPLIXIR_API_KEY!;const fileBytes = await fs.readFile("./clip.mp4");
const presignRes = await fetch("https://api.splixir.com/v1/uploads/presign", { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" }, body: JSON.stringify({ filename: "clip.mp4", contentType: "video/mp4", bytes: fileBytes.byteLength, }),});const { uploadUrl, inputUrl } = await presignRes.json();
await fetch(uploadUrl, { method: "PUT", headers: { "Content-Type": "video/mp4", "Content-Length": String(fileBytes.byteLength) }, body: fileBytes,});
const jobRes = await fetch("https://api.splixir.com/v1/jobs", { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" }, body: JSON.stringify({ kind: "video", input: inputUrl, operations: [{ type: "transcode", codec: "h264", container: "mp4" }], }),});const job = await jobRes.json();console.log(job.id);import osimport requests
KEY = os.environ["SPLIXIR_API_KEY"]HEAD = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}size = os.path.getsize("./clip.mp4")
presign = requests.post( "https://api.splixir.com/v1/uploads/presign", headers=HEAD, json={"filename": "clip.mp4", "contentType": "video/mp4", "bytes": size},).json()
with open("./clip.mp4", "rb") as fh: requests.put( presign["uploadUrl"], headers={"Content-Type": "video/mp4", "Content-Length": str(size)}, data=fh, )
job = requests.post( "https://api.splixir.com/v1/jobs", headers=HEAD, json={ "kind": "video", "input": presign["inputUrl"], "operations": [{"type": "transcode", "codec": "h264", "container": "mp4"}], },).json()print(job["id"])splixir video ./clip.mp4 --codec h264 --container mp4 -o ./out.mp4Parallel multipart uploads
Section titled “Parallel multipart uploads”Use multipart uploads for files over 50 MiB up to 10 GiB. Part sizes range from 5 MiB to 500 MiB (default 100 MiB), with up to 100 parts per session and a 24-hour session lifetime.
-
Create the upload session
Call
POST /v1/uploads/multipart/createwithfilename,contentType,kind,declaredBytes, and optionalpartSizeBytes. Splixir returnsuploadId,partSizeBytes,totalParts, andexpiresAt. -
Presign part upload URLs
Call
POST /v1/uploads/multipart/:uploadId/partswithpartNumbers(1 to 100). Splixir returns a signeduploadUrlfor each part. -
Upload parts in parallel and collect ETags
Send each slice with
PUT(limiting concurrency to 3 to 5 parallel uploads) and record theETagresponse header for eachpartNumber. -
Complete the upload
Call
POST /v1/uploads/multipart/:uploadId/completewith{ parts: [{ partNumber, etag }] }. Splixir returns aninputUrlvalid for 3600 seconds that you pass toPOST /v1/jobs.
# 1. Create sessioncurl -X POST https://api.splixir.com/v1/uploads/multipart/create \ -H "Authorization: Bearer $SPLIXIR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"filename": "film.mov", "contentType": "video/quicktime", "kind": "video", "declaredBytes": 800000000, "partSizeBytes": 100000000}'
# 2. Presign partscurl -X POST https://api.splixir.com/v1/uploads/multipart/<uploadId>/parts \ -H "Authorization: Bearer $SPLIXIR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"partNumbers": [1, 2, 3, 4, 5, 6, 7, 8]}'
# 3. Complete upload with collected ETagscurl -X POST https://api.splixir.com/v1/uploads/multipart/<uploadId>/complete \ -H "Authorization: Bearer $SPLIXIR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"parts": [{"partNumber": 1, "etag": "\"etag1\""}, {"partNumber": 2, "etag": "\"etag2\""}]}'import fs from "node:fs/promises";
const key = process.env.SPLIXIR_API_KEY!;const handle = await fs.open("./film.mov", "r");const stat = await handle.stat();
const createRes = await fetch("https://api.splixir.com/v1/uploads/multipart/create", { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" }, body: JSON.stringify({ filename: "film.mov", contentType: "video/quicktime", kind: "video", declaredBytes: stat.size, }),});const { uploadId, partSizeBytes, totalParts } = await createRes.json();
const partsRes = await fetch(`https://api.splixir.com/v1/uploads/multipart/${uploadId}/parts`, { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" }, body: JSON.stringify({ partNumbers: Array.from({ length: totalParts }, (_, i) => i + 1) }),});const { parts } = await partsRes.json();
const uploaded = [];for (const p of parts as Array<{ partNumber: number; uploadUrl: string }>) { const offset = (p.partNumber - 1) * partSizeBytes; const length = Math.min(partSizeBytes, stat.size - offset); const buffer = Buffer.allocUnsafe(length); await handle.read(buffer, 0, length, offset);
const putRes = await fetch(p.uploadUrl, { method: "PUT", body: buffer }); uploaded.push({ partNumber: p.partNumber, etag: putRes.headers.get("etag") ?? "" });}await handle.close();
const completeRes = await fetch( `https://api.splixir.com/v1/uploads/multipart/${uploadId}/complete`, { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" }, body: JSON.stringify({ parts: uploaded }), },);const { inputUrl } = await completeRes.json();console.log(inputUrl);import osfrom concurrent.futures import ThreadPoolExecutorimport requests
KEY = os.environ["SPLIXIR_API_KEY"]HEAD = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}size = os.path.getsize("./film.mov")
created = requests.post( "https://api.splixir.com/v1/uploads/multipart/create", headers=HEAD, json={"filename": "film.mov", "contentType": "video/quicktime", "kind": "video", "declaredBytes": size},).json()upload_id = created["uploadId"]part_size = created["partSizeBytes"]total_parts = created["totalParts"]
parts = requests.post( f"https://api.splixir.com/v1/uploads/multipart/{upload_id}/parts", headers=HEAD, json={"partNumbers": list(range(1, total_parts + 1))},).json()["parts"]
def send_part(part): start = (part["partNumber"] - 1) * part_size with open("./film.mov", "rb") as fh: fh.seek(start) data = fh.read(part_size) res = requests.put(part["uploadUrl"], data=data) return {"partNumber": part["partNumber"], "etag": res.headers.get("ETag", "")}
with ThreadPoolExecutor(max_workers=4) as pool: uploaded = sorted(pool.map(send_part, parts), key=lambda p: p["partNumber"])
completed = requests.post( f"https://api.splixir.com/v1/uploads/multipart/{upload_id}/complete", headers=HEAD, json={"parts": uploaded},).json()print(completed["inputUrl"])# Multipart upload triggers automatically above 50 MiBsplixir video ./film.mov --codec hevc --resolution 1080p --container mp4 -o ./out.mp4Cancel failed sessions
Section titled “Cancel failed sessions”If an upload fails partway through and you choose not to resume, call POST /v1/uploads/multipart/:uploadId/abort with an optional reason string to discard staged parts cleanly. Completed uploads cannot be aborted.
curl -X POST https://api.splixir.com/v1/uploads/multipart/<uploadId>/abort \ -H "Authorization: Bearer $SPLIXIR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"reason": "Upload canceled by client"}'