{"info":{"version":"1.0.0","description":"Remove mosaic censorship from videos with AI. Upload a video, get free 10-second previews, then process the full video with prepaid credits. Docs: https://pureframe.io/developers","title":"PureFrame API"},"components":{"schemas":{"CreatePreview":{"type":"object","properties":{"start_seconds":{"type":"integer","description":"Start of the 10-second clip (default 0)"}}},"CreateVideo":{"type":"object","required":["name","size_bytes","attest"],"properties":{"name":{"type":"string","description":"File name with extension (.mp4 .mkv .avi .mov .webm)"},"size_bytes":{"type":"integer","description":"Exact file size, up to 10 GB"},"attest":{"const":true,"type":"boolean","description":"Confirms you are 18+, the video depicts no one under 18 (real, drawn or animated) and you have the right to process it."}}},"CreatedVideo":{"type":"object","properties":{"upload":{"type":"object","properties":{"method":{"const":"PUT"},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}}},"video":{"$ref":"#/components/schemas/Video"}}},"Error":{"type":"object","properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"enum":["unauthorized","account_disabled","insufficient_credits","not_found","invalid_request","not_attested","prohibited_file_name","unsupported_file_type","file_too_large","resolution_unsupported","upload_missing","not_uploading","video_not_ready","video_busy","already_processed","preview_limit","download_unavailable","not_completed","rate_limited"]},"message":{"type":"string"}}}}},"Me":{"type":"object","properties":{"id":{"type":"integer"},"email":{"type":"string"},"credits":{"$ref":"#/components/schemas/Money"}}},"Money":{"type":"object","properties":{"formatted":{"type":"string","examples":["$1.50"]},"cents":{"type":"integer"}}},"Preview":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["processing","completed","failed"]},"number":{"type":"integer"},"url":{"type":["string","null"]},"video_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"start_seconds":{"type":"integer"}}},"PreviewList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Preview"}}}},"Video":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"state":{"enum":["awaiting_upload","ready","pending_payment","queued","processing","completed","failed","download_expired","expired"]},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"duration_seconds":{"type":["number","null"]},"size_bytes":{"type":["integer","null"]},"job":{"type":["object","null"],"properties":{"id":{"type":"integer"},"status":{"type":"string"},"started_at":{"type":["string","null"],"format":"date-time"},"stage":{"type":["string","null"],"enum":["starting_gpu","processing","finalizing",null]},"download_expires_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"progress_percent":{"type":"integer"}}},"download_url":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"price":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":"object","properties":{"resolution_tier":{"type":"string"}}}]},{"type":"null"}]}}},"VideoList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Video"}},"offset":{"type":"integer"},"total":{"type":"integer"},"limit":{"type":"integer"}}}},"securitySchemes":{"bearer":{"scheme":"bearer","type":"http","description":"API key from Settings > API (pf_live_…)"}}},"paths":{"/me":{"get":{"parameters":[],"summary":"Account and credit balance","operationId":"getMe","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/previews/{id}/file":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"summary":"Download a finished preview","operationId":"downloadPreview","responses":{"302":{"description":"Redirect to the file"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos":{"get":{"parameters":[{"in":"query","name":"limit","description":"1-100, default 20","required":false,"schema":{"type":"integer"}},{"in":"query","name":"offset","description":"default 0","required":false,"schema":{"type":"integer"}}],"summary":"List videos, newest first","operationId":"listVideos","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoList"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"description":"Upload the file with a single PUT to `upload.url`, sending `upload.headers`, then call `POST /videos/{id}/complete`.","parameters":[],"summary":"Create a video and get its upload URL","operationId":"createVideo","responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedVideo"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVideo"}}}}}},"/videos/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"summary":"Get a video (state, price, job progress, download URL)","operationId":"getVideo","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"description":"Refused (409) while the video is queued or processing.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"summary":"Delete a video and its files","operationId":"deleteVideo","responses":{"204":{"description":"Deleted"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos/{id}/complete":{"post":{"description":"Reads duration and resolution. The video becomes `ready` and gets a price.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"summary":"Finish the upload","operationId":"completeUpload","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos/{id}/download":{"get":{"description":"302 to a signed URL valid 1 hour. Files are kept 7 days after processing.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"summary":"Download the processed video","operationId":"downloadVideo","responses":{"302":{"description":"Redirect to the file"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos/{id}/process":{"post":{"description":"Charges `price` from your credits and queues the video. Returns 402 `insufficient_credits` when the balance is short. Calling it again while queued or processing returns the video unchanged.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"summary":"Process the full video, paid with credits","operationId":"processVideo","responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos/{video_id}/previews":{"get":{"parameters":[{"in":"path","name":"video_id","required":true,"schema":{"type":"string"}}],"summary":"List previews of a video","operationId":"listPreviews","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewList"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"description":"Free previews are limited per video, per day and per account until a first purchase (403 `preview_limit`).","parameters":[{"in":"path","name":"video_id","required":true,"schema":{"type":"string"}}],"summary":"Request a free 10-second preview","operationId":"createPreview","responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePreview"}}}}}}},"openapi":"3.1.0","security":[{"bearer":[]}],"servers":[{"url":"https://pureframe.io/api/v1"}]}