{"openapi":"3.1.0","info":{"title":"StableKey","description":"VFX-grade green-screen unmixing via Corridor Digital's CorridorKey neural keyer. Submit a green-screen plate from StableUpload, get back alpha + straight foreground + premultiplied RGBA mp4s ready for compositing. Operated at cost-plus-defensive-buffer; surplus reinvested. Model © Corridor Digital — corridordigital.com.","version":"0.1.0","x-guidance":"# StableKey API\n\nVFX-grade green-screen unmixing via Corridor Digital's CorridorKey neural\nkeyer. Stablekey runs CorridorKey on Modal L40S GPUs, takes a green-screen\nplate from StableUpload, and returns clean alpha + un-multiplied straight\nforeground + premultiplied RGBA mp4s ready for compositing.\n\nBase URL: `https://stablekey.dev`\n\nOperated at cost-plus-defensive-buffer (2× modeled cost). Surplus is\nreinvested into capacity, not extracted as profit. Model © Corridor Digital.\nStar their repo: https://github.com/nikopueringer/CorridorKey\n\n## What you get back\n\nFor every job, three mp4s land at agent-provided StableUpload public URLs:\n\n- **alpha** — the predicted alpha matte (linear). Grayscale mp4, sharp at\n  hair / motion-blur / translucency edges where most \"AI roto\" tools give\n  you a binary mask.\n- **fg** — the recovered straight (un-multiplied) foreground in sRGB. The\n  green spill has been mathematically undone, not just suppressed. To\n  composite, convert to linear before multiplying by alpha.\n- **processed** — the production output: linear premultiplied RGBA\n  encoded as RGB-on-black mp4 for easy preview. Drop into Premiere/Resolve\n  on top of a new background and it just works.\n\n## Required Workflow\n\nStableKey does not accept raw file uploads. Per D8 in the architecture:\nthe agent reserves every storage slot itself on stableupload.dev. There\nis no cross-app billing.\n\n```\n1. POST stableupload.dev /api/upload          # input plate\n   → upload bytes to returned uploadUrl\n2. POST stableupload.dev /api/upload × 3      # output reservations\n   → DO NOT upload bytes; forward the URLs to stablekey\n3. POST stablekey.dev /api/process            # paid: GPU compute only\n   → returns { jobId }\n4. GET  stablekey.dev /api/jobs/{jobId}       # poll every 5-10s\n```\n\nFor \"gnarly\" shots (see below), insert a step between 1 and 2:\n`POST stablesam.dev /api/segment` with prompt \"person\", upload the resulting\nmask mp4 to stableupload, and pass that URL as `hintUrl` on /api/process.\n\n## Hint generator (default: inline chroma)\n\nStablekey generates the coarse alpha hint inline using a fast chroma\nthreshold + dilate + blur. **For clean studio plates this is empirically\nequivalent in quality to SAM-3.1-generated hints.** No setup, no extra\ncalls, no extra cost — just submit `/api/process` without `hintUrl`.\n\n**Bring your own `hintUrl`** (typically by calling\n`stablesam.dev /api/segment` first) only for gnarly shots:\n\n- subject is wearing green clothing (chroma threshold will erase it)\n- complex non-green BG props (lighting equipment, etc.) you don't want\n  keyed in\n- multiple subjects in frame, you only want some of them\n- translucent FG objects (smoke, glass, sheer fabric) where green shows\n  through partly\n- visible tracking-dot crosses on the green wall (chroma will pick them up)\n\nThe added cost is ~$0.05/clip for stablesam plus an extra StableUpload\ntier purchase for the mask mp4.\n\n## Internal model resolution: always 2048×2048\n\nCorridorKey resizes every input plate to a 2048×2048 working grid for\ninference, then resizes outputs back to your declared\n`resolutionWidth × resolutionHeight`. Two practical consequences:\n\n- **Cost is sub-linear in input resolution.** Empirical (L40S\n  compile=default B=1, 250-frame 1080p smoke test): 4K is ~1.7× the\n  per-frame cost of 1080p, not 4×. **Don't downscale your input to save\n  money** — submit at the resolution your output needs.\n- **Aspect ratio is preserved by default.** Non-square inputs are\n  letterboxed to 2048² and cropped back.\n- **There is no quality benefit to inputs above 2048².** Anything larger\n  gets downscaled before inference.\n\n## Color space contract\n\nCorridorKey expects the input plate as sRGB by default; declare\n`colorSpace: \"linear\"` if your source is linear (e.g. EXR sequences\nre-encoded as mp4 in linear gamma). Get this wrong and the output looks\nwashed out / crushed.\n\n**No refund on validation mismatch (D7).** Modal validates declared\n`frameCount`, `resolutionWidth`, `resolutionHeight` against ffprobe BEFORE\nrunning inference. Compute locally:\n\n```bash\nffprobe -v error -count_packets \\\n  -show_entries stream=nb_read_packets,width,height \\\n  -of csv=p=0 your_plate.mp4\n```\n\n## Idempotency\n\nPass an opaque `clientRequestId` (UUID, ≤128 chars) on every retry. Same\n`(walletAddress, clientRequestId)` returns the existing job WITHOUT\nre-billing.\n\n## /api/process — $0.05+ per video job\n\n```json\n{\n  \"type\": \"stablekey-video\",\n  \"rgbUrl\": \"https://f.stableupload.dev/abc123/plate.mp4\",\n  \"declared\": {\n    \"frameCount\":      250,\n    \"resolutionWidth\": 1920,\n    \"resolutionHeight\":1080,\n    \"colorSpace\":      \"srgb\"\n  },\n  \"outputs\": {\n    \"alpha\":     {\"uploadUrl\": \"...\", \"publicUrl\": \"...\"},\n    \"fg\":        {\"uploadUrl\": \"...\", \"publicUrl\": \"...\"},\n    \"processed\": {\"uploadUrl\": \"...\", \"publicUrl\": \"...\"}\n  },\n  \"clientRequestId\": \"ck_2026_04_26_abc\"\n}\n```\n\nOptional: `hintUrl` (gnarly shots), `options` (CorridorKey knobs).\n\nPricing: `max(0.05, frames × (0.4 + max(0, mp - 2) × 0.085) / 3600 × $1.95 × 2)`.\n250-frame 1080p ≈ $0.10. 250-frame 4K ≈ $0.15.\n\n## /api/jobs/{jobId} — SIWX-authed status\n\n`{status: \"queued\"|\"processing\"|\"complete\"|\"failed\", result?: {outputs, metrics}, error?}`.\nPoll every 5-10s. Typical wall-time: ~2 min for a 250-frame 1080p clip.\n\nIf `error.code` is `ValidationMismatch`, declared frameCount/resolution\ndidn't match ffprobe; correct + retry with fresh `clientRequestId`.\n\n## /api/jobs — SIWX-authed list\n\nPagination via `?cursor=…&limit=50`.\n\n## DELETE /api/jobs/{jobId} — soft-delete a finished job\n","guidance":"# StableKey API\n\nVFX-grade green-screen unmixing via Corridor Digital's CorridorKey neural\nkeyer. Stablekey runs CorridorKey on Modal L40S GPUs, takes a green-screen\nplate from StableUpload, and returns clean alpha + un-multiplied straight\nforeground + premultiplied RGBA mp4s ready for compositing.\n\nBase URL: `https://stablekey.dev`\n\nOperated at cost-plus-defensive-buffer (2× modeled cost). Surplus is\nreinvested into capacity, not extracted as profit. Model © Corridor Digital.\nStar their repo: https://github.com/nikopueringer/CorridorKey\n\n## What you get back\n\nFor every job, three mp4s land at agent-provided StableUpload public URLs:\n\n- **alpha** — the predicted alpha matte (linear). Grayscale mp4, sharp at\n  hair / motion-blur / translucency edges where most \"AI roto\" tools give\n  you a binary mask.\n- **fg** — the recovered straight (un-multiplied) foreground in sRGB. The\n  green spill has been mathematically undone, not just suppressed. To\n  composite, convert to linear before multiplying by alpha.\n- **processed** — the production output: linear premultiplied RGBA\n  encoded as RGB-on-black mp4 for easy preview. Drop into Premiere/Resolve\n  on top of a new background and it just works.\n\n## Required Workflow\n\nStableKey does not accept raw file uploads. Per D8 in the architecture:\nthe agent reserves every storage slot itself on stableupload.dev. There\nis no cross-app billing.\n\n```\n1. POST stableupload.dev /api/upload          # input plate\n   → upload bytes to returned uploadUrl\n2. POST stableupload.dev /api/upload × 3      # output reservations\n   → DO NOT upload bytes; forward the URLs to stablekey\n3. POST stablekey.dev /api/process            # paid: GPU compute only\n   → returns { jobId }\n4. GET  stablekey.dev /api/jobs/{jobId}       # poll every 5-10s\n```\n\nFor \"gnarly\" shots (see below), insert a step between 1 and 2:\n`POST stablesam.dev /api/segment` with prompt \"person\", upload the resulting\nmask mp4 to stableupload, and pass that URL as `hintUrl` on /api/process.\n\n## Hint generator (default: inline chroma)\n\nStablekey generates the coarse alpha hint inline using a fast chroma\nthreshold + dilate + blur. **For clean studio plates this is empirically\nequivalent in quality to SAM-3.1-generated hints.** No setup, no extra\ncalls, no extra cost — just submit `/api/process` without `hintUrl`.\n\n**Bring your own `hintUrl`** (typically by calling\n`stablesam.dev /api/segment` first) only for gnarly shots:\n\n- subject is wearing green clothing (chroma threshold will erase it)\n- complex non-green BG props (lighting equipment, etc.) you don't want\n  keyed in\n- multiple subjects in frame, you only want some of them\n- translucent FG objects (smoke, glass, sheer fabric) where green shows\n  through partly\n- visible tracking-dot crosses on the green wall (chroma will pick them up)\n\nThe added cost is ~$0.05/clip for stablesam plus an extra StableUpload\ntier purchase for the mask mp4.\n\n## Internal model resolution: always 2048×2048\n\nCorridorKey resizes every input plate to a 2048×2048 working grid for\ninference, then resizes outputs back to your declared\n`resolutionWidth × resolutionHeight`. Two practical consequences:\n\n- **Cost is sub-linear in input resolution.** Empirical (L40S\n  compile=default B=1, 250-frame 1080p smoke test): 4K is ~1.7× the\n  per-frame cost of 1080p, not 4×. **Don't downscale your input to save\n  money** — submit at the resolution your output needs.\n- **Aspect ratio is preserved by default.** Non-square inputs are\n  letterboxed to 2048² and cropped back.\n- **There is no quality benefit to inputs above 2048².** Anything larger\n  gets downscaled before inference.\n\n## Color space contract\n\nCorridorKey expects the input plate as sRGB by default; declare\n`colorSpace: \"linear\"` if your source is linear (e.g. EXR sequences\nre-encoded as mp4 in linear gamma). Get this wrong and the output looks\nwashed out / crushed.\n\n**No refund on validation mismatch (D7).** Modal validates declared\n`frameCount`, `resolutionWidth`, `resolutionHeight` against ffprobe BEFORE\nrunning inference. Compute locally:\n\n```bash\nffprobe -v error -count_packets \\\n  -show_entries stream=nb_read_packets,width,height \\\n  -of csv=p=0 your_plate.mp4\n```\n\n## Idempotency\n\nPass an opaque `clientRequestId` (UUID, ≤128 chars) on every retry. Same\n`(walletAddress, clientRequestId)` returns the existing job WITHOUT\nre-billing.\n\n## /api/process — $0.05+ per video job\n\n```json\n{\n  \"type\": \"stablekey-video\",\n  \"rgbUrl\": \"https://f.stableupload.dev/abc123/plate.mp4\",\n  \"declared\": {\n    \"frameCount\":      250,\n    \"resolutionWidth\": 1920,\n    \"resolutionHeight\":1080,\n    \"colorSpace\":      \"srgb\"\n  },\n  \"outputs\": {\n    \"alpha\":     {\"uploadUrl\": \"...\", \"publicUrl\": \"...\"},\n    \"fg\":        {\"uploadUrl\": \"...\", \"publicUrl\": \"...\"},\n    \"processed\": {\"uploadUrl\": \"...\", \"publicUrl\": \"...\"}\n  },\n  \"clientRequestId\": \"ck_2026_04_26_abc\"\n}\n```\n\nOptional: `hintUrl` (gnarly shots), `options` (CorridorKey knobs).\n\nPricing: `max(0.05, frames × (0.4 + max(0, mp - 2) × 0.085) / 3600 × $1.95 × 2)`.\n250-frame 1080p ≈ $0.10. 250-frame 4K ≈ $0.15.\n\n## /api/jobs/{jobId} — SIWX-authed status\n\n`{status: \"queued\"|\"processing\"|\"complete\"|\"failed\", result?: {outputs, metrics}, error?}`.\nPoll every 5-10s. Typical wall-time: ~2 min for a 250-frame 1080p clip.\n\nIf `error.code` is `ValidationMismatch`, declared frameCount/resolution\ndidn't match ffprobe; correct + retry with fresh `clientRequestId`.\n\n## /api/jobs — SIWX-authed list\n\nPagination via `?cursor=…&limit=50`.\n\n## DELETE /api/jobs/{jobId} — soft-delete a finished job\n","contact":{"name":"Merit Systems","url":"https://stablekey.dev"}},"servers":[{"url":"https://stablekey.dev"}],"tags":[{"name":"Jobs"},{"name":"Process"}],"paths":{"/api/process":{"post":{"operationId":"process","summary":"Create a paid CorridorKey video keying job. Requires a StableUpload rgbUrl + reserved output slots. hintUrl is optional — when omitted, stablekey generates a chroma hint inline (D6).","tags":["Process"],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.05","max":"5.00"},"protocols":[{"x402":{}},{"mpp":{"method":"tempo","intent":"charge","currency":"0x20c0000000000000000000000000000000000001"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"stablekey-video"},"rgbUrl":{"type":"string","format":"uri","description":"StableUpload public URL of the source RGB plate (mp4)."},"hintUrl":{"description":"OPTIONAL StableUpload public URL of a coarse alpha hint mp4. When omitted, stablekey generates a chroma-key hint inline (works on clean studio plates). Bring your own SAM-derived mask via stablesam.dev for gnarly shots: subject wearing green, busy non-green BG props, multiple subjects, translucent FG.","type":"string","format":"uri"},"declared":{"type":"object","properties":{"frameCount":{"type":"integer","minimum":1,"maximum":960},"resolutionWidth":{"type":"integer","minimum":1,"maximum":4096},"resolutionHeight":{"type":"integer","minimum":1,"maximum":2160},"colorSpace":{"default":"srgb","type":"string","enum":["srgb","linear"]}},"required":["frameCount","resolutionWidth","resolutionHeight"]},"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"description":"Storage slot for the predicted alpha matte mp4."},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"description":"Storage slot for the recovered straight foreground mp4 (sRGB)."},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"description":"Storage slot for the production premultiplied RGBA mp4 (linear math)."}},"required":["alpha","fg","processed"]},"options":{"type":"object","properties":{"despillStrength":{"default":1,"type":"number","minimum":0,"maximum":1},"autoDespeckle":{"default":true,"type":"boolean"},"despeckleSize":{"default":400,"type":"integer","minimum":0,"maximum":9007199254740991},"refinerScale":{"default":1,"type":"number","minimum":0,"maximum":2}}},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","rgbUrl","declared","outputs"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["pending","queued","processing"]},"type":{"type":"string","const":"stablekey-video"},"price":{"type":"string"},"deduplicated":{"type":"boolean"}},"required":["jobId","status","type","price"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/jobs/:jobId":{"get":{"operationId":"jobs_status","summary":"Get a stablekey job status by ID","tags":["Jobs"],"security":[{"siwx":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"stablekey-video"},"status":{"type":"string","enum":["pending","queued","processing","complete","failed"]},"progress":{"type":"integer","minimum":0,"maximum":100},"input":{"type":"object","properties":{"type":{"type":"string","const":"stablekey-video"},"rgbUrl":{"type":"string","format":"uri","description":"StableUpload public URL of the source RGB plate (mp4)."},"hintUrl":{"description":"OPTIONAL StableUpload public URL of a coarse alpha hint mp4. When omitted, stablekey generates a chroma-key hint inline (works on clean studio plates). Bring your own SAM-derived mask via stablesam.dev for gnarly shots: subject wearing green, busy non-green BG props, multiple subjects, translucent FG.","type":"string","format":"uri"},"declared":{"type":"object","properties":{"frameCount":{"type":"integer","minimum":1,"maximum":960},"resolutionWidth":{"type":"integer","minimum":1,"maximum":4096},"resolutionHeight":{"type":"integer","minimum":1,"maximum":2160},"colorSpace":{"default":"srgb","type":"string","enum":["srgb","linear"]}},"required":["frameCount","resolutionWidth","resolutionHeight","colorSpace"],"additionalProperties":false},"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the predicted alpha matte mp4."},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the recovered straight foreground mp4 (sRGB)."},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the production premultiplied RGBA mp4 (linear math)."}},"required":["alpha","fg","processed"],"additionalProperties":false},"options":{"type":"object","properties":{"despillStrength":{"default":1,"type":"number","minimum":0,"maximum":1},"autoDespeckle":{"default":true,"type":"boolean"},"despeckleSize":{"default":400,"type":"integer","minimum":0,"maximum":9007199254740991},"refinerScale":{"default":1,"type":"number","minimum":0,"maximum":2}},"required":["despillStrength","autoDespeckle","despeckleSize","refinerScale"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","rgbUrl","declared","outputs"],"additionalProperties":false},"result":{"anyOf":[{"type":"object","properties":{"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false}},"required":["alpha","fg","processed"],"additionalProperties":false},"metrics":{"type":"object","properties":{"t_decode_s":{"type":"number"},"t_load_s":{"type":"number"},"t_inference_s":{"type":"number"},"t_upload_s":{"type":"number"},"frames_processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fps":{"type":"number"}},"required":["t_decode_s","t_load_s","t_inference_s","t_upload_s","frames_processed","fps"],"additionalProperties":false},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"callId":{"type":"string"}},"required":["name","callId"],"additionalProperties":false}},"required":["outputs","metrics","provider"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"logs":{"type":"array","items":{"type":"string"}},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]}},"required":["name","requestId","status","logs","error"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","progress","input","result","error","provider","createdAt","updatedAt"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"stablekey-image"},"status":{"type":"string","enum":["pending","queued","processing","complete","failed"]},"progress":{"type":"integer","minimum":0,"maximum":100},"input":{"type":"object","properties":{"type":{"type":"string","const":"stablekey-image"},"rgbUrl":{"type":"string","format":"uri"},"hintUrl":{"type":"string","format":"uri"},"declared":{"type":"object","properties":{"resolutionWidth":{"type":"integer","minimum":1,"maximum":4096},"resolutionHeight":{"type":"integer","minimum":1,"maximum":2160},"colorSpace":{"default":"srgb","type":"string","enum":["srgb","linear"]}},"required":["resolutionWidth","resolutionHeight","colorSpace"],"additionalProperties":false},"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the predicted alpha matte mp4."},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the recovered straight foreground mp4 (sRGB)."},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the production premultiplied RGBA mp4 (linear math)."}},"required":["alpha","fg","processed"],"additionalProperties":false},"options":{"type":"object","properties":{"despillStrength":{"default":1,"type":"number","minimum":0,"maximum":1},"autoDespeckle":{"default":true,"type":"boolean"},"despeckleSize":{"default":400,"type":"integer","minimum":0,"maximum":9007199254740991},"refinerScale":{"default":1,"type":"number","minimum":0,"maximum":2}},"required":["despillStrength","autoDespeckle","despeckleSize","refinerScale"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","rgbUrl","declared","outputs"],"additionalProperties":false},"result":{"anyOf":[{"type":"object","properties":{"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false}},"required":["alpha","fg","processed"],"additionalProperties":false},"metrics":{"type":"object","properties":{"t_decode_s":{"type":"number"},"t_load_s":{"type":"number"},"t_inference_s":{"type":"number"},"t_upload_s":{"type":"number"},"frames_processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fps":{"type":"number"}},"required":["t_decode_s","t_load_s","t_inference_s","t_upload_s","frames_processed","fps"],"additionalProperties":false},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"callId":{"type":"string"}},"required":["name","callId"],"additionalProperties":false}},"required":["outputs","metrics","provider"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"logs":{"type":"array","items":{"type":"string"}},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]}},"required":["name","requestId","status","logs","error"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","progress","input","result","error","provider","createdAt","updatedAt"],"additionalProperties":false}],"type":"object"}}}},"402":{"description":"Authentication Required"}}},"delete":{"operationId":"jobs_delete","summary":"Soft-delete a finished stablekey job","tags":["Jobs"],"security":[{"siwx":[]}],"responses":{"200":{"description":"Successful response"},"402":{"description":"Authentication Required"}}}},"/api/jobs":{"get":{"operationId":"jobs","summary":"List stablekey jobs for the authenticated wallet","tags":["Jobs"],"security":[{"siwx":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"stablekey-video"},"status":{"type":"string","enum":["pending","queued","processing","complete","failed"]},"progress":{"type":"integer","minimum":0,"maximum":100},"input":{"type":"object","properties":{"type":{"type":"string","const":"stablekey-video"},"rgbUrl":{"type":"string","format":"uri","description":"StableUpload public URL of the source RGB plate (mp4)."},"hintUrl":{"description":"OPTIONAL StableUpload public URL of a coarse alpha hint mp4. When omitted, stablekey generates a chroma-key hint inline (works on clean studio plates). Bring your own SAM-derived mask via stablesam.dev for gnarly shots: subject wearing green, busy non-green BG props, multiple subjects, translucent FG.","type":"string","format":"uri"},"declared":{"type":"object","properties":{"frameCount":{"type":"integer","minimum":1,"maximum":960},"resolutionWidth":{"type":"integer","minimum":1,"maximum":4096},"resolutionHeight":{"type":"integer","minimum":1,"maximum":2160},"colorSpace":{"default":"srgb","type":"string","enum":["srgb","linear"]}},"required":["frameCount","resolutionWidth","resolutionHeight","colorSpace"],"additionalProperties":false},"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the predicted alpha matte mp4."},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the recovered straight foreground mp4 (sRGB)."},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the production premultiplied RGBA mp4 (linear math)."}},"required":["alpha","fg","processed"],"additionalProperties":false},"options":{"type":"object","properties":{"despillStrength":{"default":1,"type":"number","minimum":0,"maximum":1},"autoDespeckle":{"default":true,"type":"boolean"},"despeckleSize":{"default":400,"type":"integer","minimum":0,"maximum":9007199254740991},"refinerScale":{"default":1,"type":"number","minimum":0,"maximum":2}},"required":["despillStrength","autoDespeckle","despeckleSize","refinerScale"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","rgbUrl","declared","outputs"],"additionalProperties":false},"result":{"anyOf":[{"type":"object","properties":{"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false}},"required":["alpha","fg","processed"],"additionalProperties":false},"metrics":{"type":"object","properties":{"t_decode_s":{"type":"number"},"t_load_s":{"type":"number"},"t_inference_s":{"type":"number"},"t_upload_s":{"type":"number"},"frames_processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fps":{"type":"number"}},"required":["t_decode_s","t_load_s","t_inference_s","t_upload_s","frames_processed","fps"],"additionalProperties":false},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"callId":{"type":"string"}},"required":["name","callId"],"additionalProperties":false}},"required":["outputs","metrics","provider"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"logs":{"type":"array","items":{"type":"string"}},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]}},"required":["name","requestId","status","logs","error"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","progress","input","result","error","provider","createdAt","updatedAt"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"stablekey-image"},"status":{"type":"string","enum":["pending","queued","processing","complete","failed"]},"progress":{"type":"integer","minimum":0,"maximum":100},"input":{"type":"object","properties":{"type":{"type":"string","const":"stablekey-image"},"rgbUrl":{"type":"string","format":"uri"},"hintUrl":{"type":"string","format":"uri"},"declared":{"type":"object","properties":{"resolutionWidth":{"type":"integer","minimum":1,"maximum":4096},"resolutionHeight":{"type":"integer","minimum":1,"maximum":2160},"colorSpace":{"default":"srgb","type":"string","enum":["srgb","linear"]}},"required":["resolutionWidth","resolutionHeight","colorSpace"],"additionalProperties":false},"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the predicted alpha matte mp4."},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the recovered straight foreground mp4 (sRGB)."},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Resulting public URL where the output will land after Modal uploads it."},"uploadUrl":{"type":"string","format":"uri"},"postUrl":{"type":"string","format":"uri"},"postFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["publicUrl"],"additionalProperties":false,"description":"Storage slot for the production premultiplied RGBA mp4 (linear math)."}},"required":["alpha","fg","processed"],"additionalProperties":false},"options":{"type":"object","properties":{"despillStrength":{"default":1,"type":"number","minimum":0,"maximum":1},"autoDespeckle":{"default":true,"type":"boolean"},"despeckleSize":{"default":400,"type":"integer","minimum":0,"maximum":9007199254740991},"refinerScale":{"default":1,"type":"number","minimum":0,"maximum":2}},"required":["despillStrength","autoDespeckle","despeckleSize","refinerScale"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","rgbUrl","declared","outputs"],"additionalProperties":false},"result":{"anyOf":[{"type":"object","properties":{"outputs":{"type":"object","properties":{"alpha":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"fg":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false},"processed":{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri"}},"required":["publicUrl"],"additionalProperties":false}},"required":["alpha","fg","processed"],"additionalProperties":false},"metrics":{"type":"object","properties":{"t_decode_s":{"type":"number"},"t_load_s":{"type":"number"},"t_inference_s":{"type":"number"},"t_upload_s":{"type":"number"},"frames_processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fps":{"type":"number"}},"required":["t_decode_s","t_load_s","t_inference_s","t_upload_s","frames_processed","fps"],"additionalProperties":false},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"callId":{"type":"string"}},"required":["name","callId"],"additionalProperties":false}},"required":["outputs","metrics","provider"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"type":"object","properties":{"name":{"type":"string","const":"modal"},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"logs":{"type":"array","items":{"type":"string"}},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]}},"required":["name","requestId","status","logs","error"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","progress","input","result","error","provider","createdAt","updatedAt"],"additionalProperties":false}],"type":"object"}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"402":{"description":"Authentication Required"}}}}},"components":{"securitySchemes":{"siwx":{"type":"apiKey","in":"header","name":"SIGN-IN-WITH-X"}}}}