{"openapi":"3.1.0","info":{"title":"KinoPipe API","version":"0.4.0","description":"Video editing API and MCP server: trim, resize, subtitle, watermark, merge and convert video with bounded, agent-safe tools."},"servers":[{"url":"https://kinopipe.com"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/uploads":{"post":{"operationId":"createMediaUpload","summary":"Create a direct media upload","description":"Returns a short-lived signed multipart upload policy. Submit the returned fields and file, then use mediaUrl as a job input.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadRequest"}}}},"responses":{"201":{"description":"A direct upload was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"503":{"$ref":"#/components/responses/QueueUnavailable"}}}},"/api/v1/jobs":{"get":{"operationId":"listVideoEdits","summary":"List recent video editing jobs","description":"Newest first. A cheap authenticated read: integrations use it to validate an API key without creating anything.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"The most recent jobs for this account.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"jobs":{"type":"array","items":{"$ref":"#/components/schemas/JobStatus"}}}}}}},"401":{"description":"Missing or invalid API key."}}},"post":{"operationId":"createVideoEdit","summary":"Create a video editing job","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequest"}}}},"responses":{"200":{"description":"An existing idempotent job was returned."},"202":{"description":"The edit was accepted for asynchronous processing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedJob"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientCredits"},"409":{"description":"The Idempotency-Key was already used for a different request."},"503":{"$ref":"#/components/responses/QueueUnavailable"}}}},"/api/v1/jobs/{jobId}":{"get":{"operationId":"getVideoEdit","summary":"Read a video editing job","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current job state, including the output when it has succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"The job was not found for this account."}}}},"/api/v1/tools/{slug}":{"post":{"operationId":"runVideoTool","summary":"Run a ready-made video editing tool","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","enum":["adjust-color","interpolate-frames","video-metadata","video-to-vertical","smart-crop-video","change-video-speed","normalize-audio","remove-silence-from-audio","compress-video","video-to-mp4","resize-video","extract-audio","video-thumbnail-generator","add-subtitles-to-video","trim-video","optimize-video-for-web","merge-videos","merge-audio","split-by-scenes","detect-scenes","detect-silence","detect-visual-issues","describe-video","transcribe-video","find-highlights","analyze-audio","auto-orient-video","strip-video-metadata","audiogram","add-progress-bar","boomerang-video","audio-waveform","instagram-reel","tiktok-video","youtube-short","video-filmstrip","image-to-video","add-watermark-to-video","picture-in-picture-video","create-social-video-clip","add-music-to-video","convert-video-to-gif","crop-video","remove-audio-from-video","split-video"]}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolRequest"}}}},"responses":{"200":{"description":"An existing idempotent tool run was returned."},"202":{"description":"The tool run was accepted for asynchronous processing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedJob"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientCredits"},"404":{"description":"The requested tool is not executable."},"409":{"description":"The Idempotency-Key was already used for a different request."},"503":{"$ref":"#/components/responses/QueueUnavailable"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A KinoPipe API key beginning with kp_live_."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Reuse a stable value when retrying the same edit.","schema":{"type":"string","maxLength":160}}},"schemas":{"DirectUploadRequest":{"type":"object","required":["filename","contentType","byteSize"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"contentType":{"type":"string","minLength":1,"maxLength":120,"example":"video/mp4"},"byteSize":{"type":"integer","minimum":1,"maximum":314572800}}},"DirectUploadResponse":{"type":"object","required":["ok","upload"],"properties":{"ok":{"const":true},"upload":{"type":"object","required":["uploadUrl","mediaUrl","method","fields","uploadExpiresAt","mediaExpiresAt"],"properties":{"objectKey":{"type":"string"},"uploadUrl":{"type":"string","format":"uri","description":"Signed storage form target valid for 15 minutes."},"mediaUrl":{"type":"string","format":"uri","description":"Signed input URL valid for 24 hours."},"method":{"const":"POST"},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"Append every field to multipart form data before the file."},"headers":{"type":"object","additionalProperties":{"type":"string"}},"uploadExpiresAt":{"type":"string","format":"date-time"},"mediaExpiresAt":{"type":"string","format":"date-time"}}}}},"JobRequest":{"type":"object","required":["inputs"],"properties":{"name":{"type":"string","maxLength":120,"default":"Untitled job"},"inputs":{"type":"array","minItems":1,"maxItems":6,"description":"Named HTTP(S) media inputs. Use a public URL or mediaUrl from the direct upload endpoint. The first input must use the ID main and every ID must be unique.","items":{"$ref":"#/components/schemas/MediaInput"}},"operations":{"type":"array","maxItems":12,"items":{"oneOf":[{"$ref":"#/components/schemas/TrimOperation"},{"$ref":"#/components/schemas/ResizeOperation"},{"$ref":"#/components/schemas/ThumbnailOperation"},{"$ref":"#/components/schemas/SubtitlesOperation"},{"$ref":"#/components/schemas/ConcatOperation"},{"$ref":"#/components/schemas/WatermarkOperation"},{"$ref":"#/components/schemas/PictureInPictureOperation"},{"$ref":"#/components/schemas/AddAudioOperation"},{"$ref":"#/components/schemas/CropOperation"},{"$ref":"#/components/schemas/GifOperation"},{"$ref":"#/components/schemas/RemoveAudioOperation"},{"$ref":"#/components/schemas/SplitOperation"},{"$ref":"#/components/schemas/OverlayPosition"}]},"default":[]},"output":{"$ref":"#/components/schemas/Output"},"webhook":{"$ref":"#/components/schemas/Webhook"},"maxCredits":{"type":"integer","minimum":1,"maximum":720,"description":"Optional hard ceiling for billable credits. An edit is billed the greater of rounded-up worker seconds or rounded-up 6 MiB output units. An analysis is billed one credit per started minute of the media it reads, so the ceiling caps how long the input may be and is checked before the work starts. The full amount is reserved before enqueue and unused credits are refunded after success."}}},"ToolRequest":{"type":"object","required":["inputs"],"properties":{"inputs":{"type":"array","minItems":1,"maxItems":6,"description":"Named HTTP(S) media inputs. Every tool requires main; multi-input tools document their additional IDs.","items":{"$ref":"#/components/schemas/MediaInput"}},"options":{"type":"object","additionalProperties":true,"default":{}},"webhook":{"$ref":"#/components/schemas/Webhook"},"maxCredits":{"type":"integer","minimum":1,"maximum":720,"description":"Optional hard ceiling for billable credits. An edit is billed the greater of rounded-up worker seconds or rounded-up 6 MiB output units. An analysis is billed one credit per started minute of the media it reads, so the ceiling caps how long the input may be and is checked before the work starts. The full amount is reserved before enqueue and unused credits are refunded after success."}}},"MediaInput":{"type":"object","required":["id","url"],"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_-]*$","maxLength":40,"description":"A stable name used by operations to reference this input."},"url":{"type":"string","format":"uri","description":"A public HTTP(S) URL or the mediaUrl returned by POST /api/v1/uploads."},"filename":{"type":"string","maxLength":180}}},"Output":{"type":"object","properties":{"format":{"type":"string","enum":["mp4","webm","mp3","wav","jpg","webp","gif"],"default":"mp4"},"quality":{"type":"string","enum":["fast","balanced","quality"],"default":"balanced"}}},"Webhook":{"type":"object","required":["url","secret"],"properties":{"url":{"type":"string","format":"uri","description":"A public HTTPS endpoint using the default port."},"secret":{"type":"string","minLength":16,"maxLength":256,"writeOnly":true,"description":"Used to sign X-KinoPipe-Signature with HMAC-SHA256."},"events":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","enum":["job.succeeded","job.failed"]},"default":["job.succeeded","job.failed"]}}},"Job":{"type":"object","required":["id","status","progress"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["queued","processing","succeeded","failed","canceled"]},"progress":{"type":"integer","minimum":0,"maximum":100},"consumedCredits":{"type":"integer","minimum":0},"reservedCredits":{"type":"integer","minimum":0,"description":"Credits reserved for this job before it was enqueued."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":720,"description":"Hard billable credit ceiling, when supplied. For edits it caps worker time and output size; for analyses, which are billed per started minute of media, it caps how long the input may be and is checked before the work starts."},"creditBalance":{"type":"integer","minimum":0},"error":{"$ref":"#/components/schemas/Error"}}},"AcceptedJob":{"type":"object","required":["ok","job","statusUrl"],"properties":{"ok":{"const":true},"reused":{"type":"boolean"},"job":{"$ref":"#/components/schemas/Job"},"statusUrl":{"type":"string","description":"Relative URL to poll with the same API key."}}},"JobStatus":{"type":"object","required":["ok","job"],"properties":{"ok":{"const":true},"job":{"$ref":"#/components/schemas/Job"},"result":{"$ref":"#/components/schemas/JobResult"}}},"JobResult":{"type":"object","required":["output","runtimeMs"],"properties":{"output":{"$ref":"#/components/schemas/MediaOutput"},"outputs":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/MediaOutput"}},"runtimeMs":{"type":"integer","minimum":0},"analysis":{"type":"object","additionalProperties":true,"description":"Present for analysis tools (detect-scenes, detect-silence, analyze-audio, detect-visual-issues, describe-video): the same JSON as the output file, inline. Also present on smart-crop-video renders (kind smart_crop: the layout chosen per shot). The kind field names the shape: scene_detection, silence_detection, audio_analysis, visual_issues, video_description or smart_crop."}}},"MediaOutput":{"type":"object","required":["objectKey","downloadUrl","contentType","byteSize"],"properties":{"objectKey":{"type":"string"},"storageUri":{"type":"string","description":"Provider-neutral storage URI such as r2://bucket/key or gs://bucket/key."},"gcsUri":{"type":"string","deprecated":true,"description":"Legacy storage URI field kept for backward compatibility."},"downloadUrl":{"type":"string","format":"uri","description":"Signed temporary download URL."},"downloadUrlExpiresAt":{"type":"string","format":"date-time"},"contentType":{"type":"string"},"byteSize":{"type":"integer","minimum":0},"filename":{"type":"string"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}},"TrimOperation":{"type":"object","required":["type","start"],"properties":{"type":{"const":"trim"},"start":{"type":"number","minimum":0,"maximum":86400},"end":{"type":"number","exclusiveMinimum":0,"maximum":86400}}},"ResizeOperation":{"type":"object","required":["type","width","height"],"properties":{"type":{"const":"resize"},"width":{"type":"integer","minimum":16,"maximum":4096},"height":{"type":"integer","minimum":16,"maximum":4096},"fit":{"type":"string","enum":["cover","contain"],"default":"cover"}}},"ThumbnailOperation":{"type":"object","required":["type"],"properties":{"type":{"const":"thumbnail"}}},"SubtitlesOperation":{"type":"object","required":["type"],"properties":{"type":{"const":"subtitles"},"url":{"type":"string","format":"uri","description":"A public HTTP(S) SRT or WebVTT URL."},"input":{"type":"string","pattern":"^[a-z][a-z0-9_-]*$","maxLength":40,"description":"ID of a named SRT or WebVTT input."}},"oneOf":[{"required":["url"]},{"required":["input"]}]},"ConcatOperation":{"type":"object","required":["type","inputs"],"properties":{"type":{"const":"concat"},"inputs":{"type":"array","minItems":2,"maxItems":6,"uniqueItems":true,"items":{"type":"string","pattern":"^[a-z][a-z0-9_-]*$","maxLength":40}},"width":{"type":"integer","minimum":16,"maximum":4096,"default":1280},"height":{"type":"integer","minimum":16,"maximum":4096,"default":720}}},"WatermarkOperation":{"type":"object","required":["type","input"],"properties":{"type":{"const":"watermark"},"input":{"type":"string","pattern":"^[a-z][a-z0-9_-]*$","maxLength":40},"position":{"$ref":"#/components/schemas/OverlayPosition"},"width":{"type":"integer","minimum":16,"maximum":2048,"default":240},"opacity":{"type":"number","minimum":0.05,"maximum":1,"default":0.85},"margin":{"type":"integer","minimum":0,"maximum":512,"default":24}}},"PictureInPictureOperation":{"type":"object","required":["type","input"],"properties":{"type":{"const":"picture_in_picture"},"input":{"type":"string","pattern":"^[a-z][a-z0-9_-]*$","maxLength":40},"position":{"$ref":"#/components/schemas/OverlayPosition"},"width":{"type":"integer","minimum":64,"maximum":2048,"default":360},"margin":{"type":"integer","minimum":0,"maximum":512,"default":24}}},"AddAudioOperation":{"type":"object","required":["type","input"],"properties":{"type":{"const":"add_audio"},"input":{"type":"string","pattern":"^[a-z][a-z0-9_-]*$","maxLength":40},"mode":{"type":"string","enum":["mix","replace"],"default":"mix"},"musicVolume":{"type":"number","minimum":0,"maximum":2,"default":0.3},"sourceVolume":{"type":"number","minimum":0,"maximum":2,"default":1},"loop":{"type":"boolean","default":true}}},"CropOperation":{"type":"object","required":["type"],"properties":{"type":{"const":"crop"},"aspectRatio":{"type":"string","enum":["9:16","1:1","4:5","16:9"],"default":"9:16"},"focus":{"type":"string","enum":["center","top","bottom","left","right"],"default":"center"}}},"GifOperation":{"type":"object","required":["type"],"properties":{"type":{"const":"gif"},"fps":{"type":"integer","minimum":5,"maximum":30,"default":15},"width":{"type":"integer","minimum":160,"maximum":1280,"default":640},"maxColors":{"type":"integer","minimum":32,"maximum":256,"default":256}}},"RemoveAudioOperation":{"type":"object","required":["type"],"properties":{"type":{"const":"remove_audio"}}},"SplitOperation":{"type":"object","required":["type","segmentDuration"],"properties":{"type":{"const":"split"},"segmentDuration":{"type":"number","minimum":1,"maximum":3600},"maxSegments":{"type":"integer","minimum":2,"maximum":50,"default":50}}},"OverlayPosition":{"type":"string","enum":["top-left","top-right","bottom-left","bottom-right","center"],"default":"bottom-right"}},"responses":{"BadRequest":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"A valid KinoPipe API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InsufficientCredits":{"description":"The account does not have enough credits to start another edit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"QueueUnavailable":{"description":"The video edit could not be placed on the render queue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}