{"service":"cognisark-multimedia-factory","product":"Wan Lightning I2V video factory","base_url":"https://multimedia.cognisark.com","auth":{"header":"Authorization: Bearer <token>","alternatives":["X-Api-Key: <token>","X-Api-Token: <token>","?token=<token>"],"master":"Env API_TOKEN — full admin + key management","api_keys":"Created via POST /api/keys (master only). Prefix mmf_…"},"endpoints":[{"method":"GET","path":"/health","auth":false,"desc":"Liveness + config readiness. No prompt required. Safe for agents/cron."},{"method":"GET","path":"/help","auth":false,"desc":"This document."},{"method":"POST","path":"/api/v1/videos","auth":true,"desc":"Create one Wan I2V clip from a start image + prompt.","body":{"prompt":"string (required)","image_url":"https://… (or image_base64)","image_base64":"optional raw/data-URL base64","name":"optional project name","idempotency_key":"optional — same key + same body replays without a new GPU (24h TTL)","params":{"aspect_ratio":"16:9 | 9:16","duration_seconds":"number → maps to odd num_frames @ fps (17–161)","num_frames":"odd int (overrides duration_seconds if set)","resolution":"720p | 1080p (sets scale_height/width)","rife":"boolean (default true)","rife_multiplier":2,"scale_height":"720 | 1080 (landscape; optional if resolution set)","scale_width":"720 | 1080 (portrait)","upscale_backend":"ffmpeg | realesrgan | seedvr2","fps":15,"steps":4}},"response":{"success":true,"generation_id":"uuid","project_id":"uuid","status":"WAITING_CAPACITY|PROVISIONING|ACTIVE","estimated_cost_usd":0.028,"jobs":[{"id":"…","step_type":"video_wan|interpolate","status":"QUEUED"}],"poll":"GET /api/v1/videos/{generation_id}","replay":"optional true when an existing generation was returned (no new GPU)","replay_reason":"idempotency_key | fingerprint"},"idempotency":{"header":"Idempotency-Key: <unique-string> (preferred)","body":"idempotency_key field (alternative)","scope":"per API key (master token uses scope master)","ttl_hours":24,"conflict":"HTTP 409 if same key is reused with a different request body","fingerprint":"Even without a key, identical prompt + image + params within TTL return the same generation (in-flight or completed) — no duplicate GPU."}},{"method":"POST","path":"/api/v1/videos/bulk","auth":true,"desc":"Create up to 50 videos in one JSON request.","body":{"items":["same shape as POST /api/v1/videos × N"]},"response":{"success":true,"results":["VideoCreateResult[]"],"errors":[{"index":0,"error":"string"}]}},{"method":"GET","path":"/api/v1/videos/:generation_id","auth":true,"desc":"Status + artifact URLs for one generation (scoped to the calling key)."},{"method":"GET","path":"/api/v1/videos?limit=50&offset=0","auth":true,"desc":"Generation history for the calling key (master sees all)."},{"method":"GET","path":"/api/v1/usage","auth":true,"desc":"Per-key totals: count, cost, render seconds, output bytes."},{"method":"POST","path":"/api/keys","auth":"master","desc":"Create an API key. Returns the raw key once.","body":{"name":"string"}},{"method":"GET","path":"/api/keys","auth":"master","desc":"List keys + usage aggregates (never returns raw secrets)."},{"method":"POST","path":"/api/keys/:id/revoke","auth":"master","desc":"Revoke a key."}],"status_machine":{"generation":["queued","provisioning","running","completed","failed","terminated"],"notes":["Poll GET /api/v1/videos/:id until status is completed|failed|terminated.","On completed, use play_url / download_url for the mp4.","project.status TERMINATED with generation.status completed is normal — GPU was released after idle grace.","If Thunder instance vanishes mid-job, the fleet auto re-provisions once."]},"engine":{"model":"Wan 2.2 Lightning 14B (video_wan)","native":"960×544 (16:9) or 544×960 (9:16)","default":"15 fps · ~81 frames · 4 steps · RIFE ×2 → 30 fps · ffmpeg → 720p"},"curl_examples":{"health":"curl -s https://multimedia.cognisark.com/health","create":"curl -s -X POST https://multimedia.cognisark.com/api/v1/videos -H \"Authorization: Bearer $MMF_KEY\" -H \"Content-Type: application/json\" -d '{\"prompt\":\"Slow push-in\",\"image_url\":\"https://example.com/start.png\",\"params\":{\"aspect_ratio\":\"16:9\",\"rife\":true}}'","status":"curl -s https://multimedia.cognisark.com/api/v1/videos/$GENERATION_ID -H \"Authorization: Bearer $MMF_KEY\"","bulk":"curl -s -X POST https://multimedia.cognisark.com/api/v1/videos/bulk -H \"Authorization: Bearer $MMF_KEY\" -H \"Content-Type: application/json\" -d '{\"items\":[{\"prompt\":\"A\",\"image_url\":\"https://…/a.png\"},{\"prompt\":\"B\",\"image_url\":\"https://…/b.png\"}]}'"}}