{"openapi":"3.1.0","info":{"title":"ModelMix Video Tasks","version":"1.0.0"},"paths":{"/videos":{"post":{"tags":["video"],"summary":"Create Video","operationId":"create_video","security":[{"ModelMixBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"description":"Stable per logical operation; same request replays its current task","title":"Idempotency-Key"},"description":"Stable per logical operation; same request replays its current task"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoCreateRequest"}}}},"responses":{"202":{"description":"Accepted or replayed task; inspect status and requires_action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTask"}}},"headers":{"Location":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}},"description":"Unauthorized"},"402":{"description":"Budget or available credit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}},"description":"Forbidden"},"409":{"description":"Idempotency key/request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}}},"429":{"description":"Rate or concurrency limit","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}}},"502":{"description":"Check error.metadata.generation_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}}}}}},"/videos/{task_id}":{"get":{"tags":["video"],"summary":"Get Video","operationId":"get_video","security":[{"ModelMixBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTask"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoErrorResponse"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoAudio":{"properties":{"type":{"type":"string","const":"audio_url","title":"Type"},"audio_url":{"$ref":"#/components/schemas/VideoReferenceURL"},"role":{"type":"string","enum":["reference_audio","driving_audio"],"title":"Role","default":"reference_audio"}},"additionalProperties":false,"type":"object","required":["type","audio_url"],"title":"VideoAudio"},"VideoCreateRequest":{"properties":{"provider_options":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Provider Options"},"model":{"type":"string","minLength":1,"title":"Model","description":"Explicit, enabled video model ID"},"content":{"items":{"oneOf":[{"$ref":"#/components/schemas/VideoText"},{"$ref":"#/components/schemas/VideoImage"},{"$ref":"#/components/schemas/VideoReference"},{"$ref":"#/components/schemas/VideoAudio"}],"discriminator":{"propertyName":"type","mapping":{"audio_url":"#/components/schemas/VideoAudio","image_url":"#/components/schemas/VideoImage","text":"#/components/schemas/VideoText","video_url":"#/components/schemas/VideoReference"}}},"type":"array","maxItems":51,"minItems":1,"title":"Content","description":"Include a text prompt; reference combinations are model-specific"},"duration":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":2.0},{"type":"integer","const":-1}],"title":"Duration","description":"Seconds; -1 lets supported Seedance 2.x routes choose the duration","default":5},"resolution":{"type":"string","enum":["480p","512p","720p","768p","1080p","2k","4k"],"title":"Resolution","description":"4k requires a supported Seedance route with approved pricing and usage bounds","default":"720p"},"ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9","adaptive"],"title":"Ratio","description":"Omit for HappyHorse image-to-video"},"seed":{"type":"integer","maximum":4294967295.0,"minimum":-1.0,"title":"Seed"},"watermark":{"type":"boolean","title":"Watermark"},"generate_audio":{"type":"boolean","title":"Generate Audio","description":"Seedance only; omit for HappyHorse and Wan"},"return_last_frame":{"type":"boolean","title":"Return Last Frame","description":"Seedance only"},"provider":{"additionalProperties":true,"type":"object","title":"Provider","description":"Optional routing restrictions"}},"additionalProperties":false,"type":"object","required":["model","content"],"title":"VideoCreateRequest"},"VideoErrorDetail":{"properties":{"message":{"type":"string","title":"Message"},"type":{"type":"string","title":"Type"},"code":{"type":"integer","title":"Code"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["message","type","code"],"title":"VideoErrorDetail"},"VideoErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/VideoErrorDetail"}},"type":"object","required":["error"],"title":"VideoErrorResponse"},"VideoImage":{"properties":{"type":{"type":"string","const":"image_url","title":"Type"},"image_url":{"$ref":"#/components/schemas/VideoImageURL"},"role":{"type":"string","enum":["first_frame","last_frame","reference_image"],"title":"Role","default":"first_frame"},"reference_voice":{"anyOf":[{"$ref":"#/components/schemas/VideoReferenceURL"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["type","image_url"],"title":"VideoImage"},"VideoImageURL":{"properties":{"url":{"type":"string","maxLength":7340032,"minLength":1,"title":"Url","description":"HTTPS image URL or inline PNG/JPEG/WebP (5 MiB each, 45 MiB total)"}},"additionalProperties":false,"type":"object","required":["url"],"title":"VideoImageURL"},"VideoReference":{"properties":{"type":{"type":"string","const":"video_url","title":"Type"},"video_url":{"$ref":"#/components/schemas/VideoReferenceURL"},"role":{"type":"string","enum":["reference_video","first_clip"],"title":"Role","default":"reference_video"},"reference_voice":{"anyOf":[{"$ref":"#/components/schemas/VideoReferenceURL"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["type","video_url"],"title":"VideoReference"},"VideoReferenceURL":{"properties":{"url":{"type":"string","maxLength":16384,"minLength":1,"title":"Url","description":"Publicly reachable HTTPS URL; private OSS signed URLs are supported"}},"additionalProperties":false,"type":"object","required":["url"],"title":"VideoReferenceURL"},"VideoTask":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"video","title":"Object"},"model":{"type":"string","title":"Model"},"status":{"type":"string","enum":["submitting","queued","running","succeeded","failed","cancelled","expired","submission_unknown"],"title":"Status"},"created_at":{"type":"integer","title":"Created At"},"updated_at":{"type":"integer","title":"Updated At"},"terminal":{"type":"boolean","title":"Terminal"},"requires_action":{"type":"boolean","title":"Requires Action"},"poll_after_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Poll After Seconds"},"task_path":{"type":"string","title":"Task Path"},"billing_status":{"type":"string","title":"Billing Status"},"cost_is_provisional":{"type":"boolean","title":"Cost Is Provisional"},"cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost"},"currency":{"type":"string","title":"Currency"},"is_byok":{"type":"boolean","title":"Is Byok"},"content":{"anyOf":[{"$ref":"#/components/schemas/VideoTaskContent"},{"type":"null"}]},"usage":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"number"}]},"type":"object"},{"type":"null"}],"title":"Usage"},"error":{"anyOf":[{"$ref":"#/components/schemas/VideoTaskMessage"},{"type":"null"}]},"warning":{"anyOf":[{"$ref":"#/components/schemas/VideoTaskMessage"},{"type":"null"}]},"storage":{"anyOf":[{"type":"string","const":"supplier_reference"},{"type":"null"}],"title":"Storage"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At","description":"Null when supplier expiry is unknown"},"content_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Path"},"save_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Save Path"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"ratio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ratio"},"generate_audio":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Generate Audio"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"backup":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Backup"}},"type":"object","required":["id","object","model","status","created_at","updated_at","terminal","requires_action","poll_after_seconds","task_path","billing_status","cost_is_provisional","cost","currency","is_byok"],"title":"VideoTask"},"VideoTaskContent":{"properties":{"video_url":{"type":"string","title":"Video Url"},"last_frame_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Frame Url"}},"type":"object","required":["video_url"],"title":"VideoTaskContent"},"VideoTaskMessage":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"retryable":{"type":"boolean","title":"Retryable"},"reference_images":{"anyOf":[{"items":{"type":"integer","maximum":30.0,"minimum":1.0},"type":"array","maxItems":30},{"type":"null"}],"title":"Reference Images","description":"One-based indices of rejected input images"}},"type":"object","required":["code","message","retryable"],"title":"VideoTaskMessage"},"VideoText":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","maxLength":10000,"minLength":1,"title":"Text"}},"additionalProperties":false,"type":"object","required":["type","text"],"title":"VideoText"}},"securitySchemes":{"ModelMixBearer":{"type":"http","scheme":"bearer"}}},"servers":[{"url":"http://api.modelmix.tech/api/v1"}]}