{"openapi":"3.1.0","info":{"title":"Maosika Video Generation API","version":"v2","summary":"MiniMax-H3-Max video generation, request/response-compatible with the official MiniMax v2 API.","description":"Paths, request bodies, responses and error envelopes are identical to the official MiniMax video generation API (v2). Code written against the official docs runs here after two changes: point it at `https://api.maosika.com` and use a Maosika API key as the Bearer token.\n\nExtensions beyond the official API: resolutions 480P / 720P, durations up to 30 s, ratios 3:2 / 2:3, the `adjustments` field, and the `X-Request-Id` response header on every response.\n\nDocs: https://www.maosika.com/platform/docs\n\nAlso available on the same key and wallet: **video upscale** (`/v2/video_upscale`, our own endpoint, not part of the official API) — raises a video to 720P or 1080P.","termsOfService":"https://www.maosika.com/terms","contact":{"name":"Maosika","url":"https://www.maosika.com/contact"}},"servers":[{"url":"https://api.maosika.com","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"video","description":"Video generation tasks"},{"name":"upscale","description":"Video upscale tasks (raise a video to 720P or 1080P)"}],"paths":{"/v2/video_generation":{"post":{"tags":["video"],"operationId":"createVideoGeneration","summary":"Create a video generation task","description":"Submits a task and returns its id immediately. Poll `GET /v2/query/video_generation/{task_id}` or supply `callback_url`. The price is pre-charged on creation and fully refunded if the task fails or is cancelled.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVideoGenerationRequest"},"examples":{"text_to_video":{"summary":"Text to video","value":{"model":"MiniMax-H3-Max","content":[{"type":"text","text":"A cat astronaut floating inside a space station, soft light, cinematic"}],"resolution":"720P","duration":5,"ratio":"16:9"}},"first_frame":{"summary":"Image to video (first frame)","value":{"model":"MiniMax-H3-Max","content":[{"type":"text","text":"The camera slowly pushes in as she looks up and smiles"},{"type":"image_url","image_url":{"url":"https://example.com/first-frame.jpg"},"role":"first_frame"}],"resolution":"720P","duration":5,"ratio":"adaptive"}},"reference":{"summary":"Reference image + reference audio","value":{"model":"MiniMax-H3-Max","content":[{"type":"text","text":"<Picture 1> walks through a rainy night market, neon reflections, handheld camera"},{"type":"image_url","image_url":{"url":"https://example.com/character.jpg"},"role":"reference_image"},{"type":"audio_url","audio_url":{"url":"https://example.com/voice.mp3"},"role":"reference_audio"}],"resolution":"2K","duration":8,"ratio":"9:16"}}}}}},"responses":{"200":{"description":"Task accepted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVideoGenerationResponse"},"example":{"task_id":"1789383217076969"}}}},"400":{"description":"Invalid request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"bad_request_error","message":"content must include at least one non-empty text item (the prompt)","http_code":"400"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Insufficient balance","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"insufficient_balance_error","message":"insufficient balance: this task needs CNY 5.68 (USD 0.80), available CNY 0.00; top up at https://www.maosika.com/platform/console/billing","http_code":"402"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v2/query/video_generation/{task_id}":{"get":{"tags":["video"],"operationId":"queryVideoGeneration","summary":"Query a task","description":"Returns the task's status and, when succeeded, a signed download link. Only tasks created within the retention window can be queried.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Task","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["task"],"properties":{"task":{"$ref":"#/components/schemas/Task"}}},"examples":{"succeeded":{"value":{"task":{"id":"1789383217076969","model":"MiniMax-H3-Max","status":"succeeded","created_at":1789383217,"updated_at":1789383412,"content":{"url":"https://api.maosika.com/v2/files/1789383217076969/video.mp4?expires=1789469812&sig=…"},"resolution":"720P","duration":5,"ratio":"16:9","task_type":"generation","modality":"video","usage":{"total_seconds":5,"input_seconds":0,"output_seconds":5,"input_image_count":0,"input_audio_seconds":0}}}},"running":{"value":{"task":{"id":"1789383217076969","model":"MiniMax-H3-Max","status":"running","created_at":1789383217,"updated_at":1789383260,"resolution":"720P","duration":5,"ratio":"16:9","task_type":"generation","modality":"video"}}},"failed":{"value":{"task":{"id":"1789383217076969","model":"MiniMax-H3-Max","status":"failed","created_at":1789383217,"updated_at":1789383300,"resolution":"720P","duration":5,"ratio":"16:9","task_type":"generation","modality":"video","error":{"code":"generation_failed","message":"video generation failed"}}}}}}}},"400":{"description":"Unknown task id","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"bad_request_error","message":"invalid task_id","http_code":"400"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v2/query/video_generation":{"get":{"tags":["video"],"operationId":"listVideoGeneration","summary":"List tasks","description":"Pages through tasks created within the retention window.","security":[{"bearerAuth":[]}],"parameters":[{"name":"page_num","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"page_size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"filter.status","in":"query","schema":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]}},{"name":"filter.task_ids","in":"query","description":"Comma-separated, or repeat the parameter.","schema":{"type":"string"}},{"name":"filter.model","in":"query","schema":{"type":"string","enum":["MiniMax-H3-Max","MiniMax-H3"]}},{"name":"filter.task_type","in":"query","schema":{"type":"string","enum":["generation"]}}],"responses":{"200":{"description":"Page of tasks","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["items","total"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"total":{"type":"integer","description":"Matching tasks in the window."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v2/video_generation/{task_id}":{"delete":{"tags":["video"],"operationId":"cancelOrDeleteVideoGeneration","summary":"Cancel a queued task or delete a finished one","description":"queued → cancelled (full refund). succeeded / failed → record and file deleted. running and already-cancelled tasks return 400.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Done","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["task_id","action","status"],"properties":{"task_id":{"type":"string"},"action":{"type":"string","enum":["cancelled","deleted"]},"status":{"type":"string","enum":["cancelled","deleted"]}}},"examples":{"cancelled":{"value":{"task_id":"1789383217076969","action":"cancelled","status":"cancelled"}},"deleted":{"value":{"task_id":"1789383217076969","action":"deleted","status":"deleted"}}}}}},"400":{"description":"Cannot cancel","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"bad_request_error","message":"cannot cancel a task while it is processing","http_code":"400"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v2/files/{task_id}/video.mp4":{"get":{"tags":["video"],"operationId":"downloadVideo","summary":"Download the finished video (signed link)","description":"This is the `content.url` returned by Query. The link is self-authenticating via `expires` + `sig` — send no Authorization header. Expired links return 401; query the task again for a fresh one.","security":[],"parameters":[{"$ref":"#/components/parameters/TaskId"},{"name":"expires","in":"query","required":true,"schema":{"type":"integer"}},{"name":"sig","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"MP4 file","content":{"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"File no longer available","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"bad_request_error","message":"the video for this task is no longer available","http_code":"400"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"401":{"description":"Link invalid or expired","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"authorized_error","message":"download link is invalid or expired; query the task again for a fresh link","http_code":"401"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}}}}},"/v2/video_upscale":{"post":{"tags":["upscale"],"operationId":"createVideoUpscale","summary":"Create a video upscale task","description":"Returns a task id immediately; the source video is downloaded in the background. Billed per second of the source video (rounded up, minimum 3 s) from the API wallet once the video has been read; nothing is charged if the video is rejected, and the charge is fully refunded if the task fails.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVideoUpscaleRequest"},"examples":{"from_url":{"summary":"Upscale a video by URL","value":{"model":"Maosika-Upscale","video_url":"https://example.com/clip-480p.mp4","resolution":"1080P"}},"from_task":{"summary":"Upscale a finished video generation task","value":{"model":"Maosika-Upscale","source_task_id":"175870000000012345","resolution":"1080P"}}}}}},"responses":{"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"},"200":{"description":"Task accepted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["task_id"],"properties":{"task_id":{"type":"string"}}},"example":{"task_id":"175870000000012345"}}}},"400":{"$ref":"#/components/responses/UpscaleBadRequest"},"402":{"$ref":"#/components/responses/UpscaleNoBalance"}}}},"/v2/query/video_upscale/{task_id}":{"get":{"tags":["upscale"],"operationId":"queryVideoUpscale","summary":"Query an upscale task","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"},"200":{"description":"Task","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["task"],"properties":{"task":{"$ref":"#/components/schemas/UpscaleTask"}}},"examples":{"succeeded":{"value":{"task":{"id":"175870000000012345","model":"Maosika-Upscale","status":"succeeded","created_at":1789383217,"updated_at":1789383412,"resolution":"1080P","task_type":"upscale","modality":"video","source":{"type":"video_url"},"input":{"width":854,"height":480,"duration":15.0,"fps":"24/1"},"output":{"width":1920,"height":1080},"content":{"url":"https://api.maosika.com/v2/files/175870000000012345/upscaled.mp4?expires=1789469812&sig=…"},"usage":{"billable_seconds":15}}}}}}}},"400":{"$ref":"#/components/responses/UpscaleBadRequest"}}}},"/v2/query/video_upscale":{"get":{"tags":["upscale"],"operationId":"listVideoUpscale","summary":"List upscale tasks","security":[{"bearerAuth":[]}],"parameters":[{"name":"page_num","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"page_size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"filter.status","in":"query","schema":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]}},{"name":"filter.task_ids","in":"query","description":"Comma-separated, or repeat the parameter.","schema":{"type":"string"}}],"responses":{"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"},"200":{"description":"Page of tasks","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["items","total"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UpscaleTask"}},"total":{"type":"integer"}}}}}}}}},"/v2/video_upscale/{task_id}":{"delete":{"tags":["upscale"],"operationId":"cancelOrDeleteVideoUpscale","summary":"Cancel a queued upscale task or delete a finished one","description":"queued → cancelled (nothing was charged yet). succeeded / failed → record and file deleted. running and already-cancelled tasks return 400.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"},"200":{"description":"Done","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["task_id","action","status"],"properties":{"task_id":{"type":"string"},"action":{"type":"string","enum":["cancelled","deleted"]},"status":{"type":"string","enum":["cancelled","deleted"]}}}}}},"400":{"$ref":"#/components/responses/UpscaleBadRequest"}}}},"/v2/files/{task_id}/upscaled.mp4":{"get":{"tags":["upscale"],"operationId":"downloadUpscaledVideo","summary":"Download the upscaled video (signed link)","description":"The `content.url` returned by Query; authenticated by `expires` + `sig`, send no Authorization header.","security":[],"parameters":[{"$ref":"#/components/parameters/TaskId"},{"name":"expires","in":"query","required":true,"schema":{"type":"integer"}},{"name":"sig","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"MP4 file","content":{"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/UpscaleBadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Maosika API key (mk-...)","description":"Create keys in the console: https://www.maosika.com/platform/console/keys"}},"headers":{"X-Request-Id":{"description":"Unique id of this request; quote it when contacting support.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying (on 429).","schema":{"type":"integer"}}},"parameters":{"TaskId":{"name":"task_id","in":"path","required":true,"schema":{"type":"string"},"example":"1789383217076969"}},"responses":{"Unauthorized":{"description":"Missing / invalid / revoked API key","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"authorized_error","message":"invalid api key","http_code":"401"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"RateLimited":{"description":"Too many requests or too many in-flight tasks","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"rate_limit_error","message":"too many in-flight tasks for this account (limit 5); wait for running tasks to finish","http_code":"429"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"Unavailable":{"description":"API temporarily disabled or pricing not configured","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"server_error","message":"the video generation API is temporarily disabled","http_code":"503"},"request_id":"7c2b2d2a3c3f4a1e9d2b0c6c8a1f2e3d"}}}},"UpscaleBadRequest":{"description":"Invalid request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"bad_request_error","message":"provide exactly one of video_url or source_task_id","http_code":"400"},"request_id":"…"}}}},"UpscaleNoBalance":{"description":"The API wallet is empty","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"type":"error","error":{"type":"insufficient_balance_error","message":"this account has no API wallet balance; top up at https://www.maosika.com/platform/console/billing to continue","http_code":"402"},"request_id":"…"}}}}},"schemas":{"Error":{"type":"object","description":"Error envelope (identical to the official MiniMax API).","required":["type","error","request_id"],"properties":{"type":{"type":"string","const":"error"},"error":{"type":"object","required":["type","message","http_code"],"properties":{"type":{"type":"string","enum":["bad_request_error","authorized_error","insufficient_balance_error","unprocessable_entity_error","rate_limit_error","server_error"]},"message":{"type":"string","description":"Human-readable English explanation."},"http_code":{"type":"string","description":"HTTP status as a string, e.g. \"400\"."}}},"request_id":{"type":"string","description":"Quote this when contacting support."}}},"ContentItem":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","image_url","video_url","audio_url"]},"text":{"type":"string","maxLength":7000,"description":"The prompt (type=text). Several text items are joined with newlines. Reference media are numbered per kind in content order: <Picture 1>, <Video 1>, <Audio 1>."},"image_url":{"type":"object","properties":{"url":{"type":"string","description":"https URL or data:image/...;base64 URI. JPG / PNG / WEBP / HEIC / HEIF, ≤ 30MB, side 256–5760 px, aspect 0.4–2.5."}}},"video_url":{"type":"object","properties":{"url":{"type":"string","description":"https URL. MP4 / MOV, ≤ 50MB, 2–15 s per clip, ≤ 15 s total, ≤ 3 clips."}}},"audio_url":{"type":"object","properties":{"url":{"type":"string","description":"https URL. WAV / MP3, ≤ 15MB, 2–15 s per clip, ≤ 15 s total, ≤ 3 clips."}}},"role":{"type":"string","enum":["first_frame","last_frame","reference_image","reference_video","reference_audio"],"description":"What the media is for. An image without role is treated as reference_image. first_frame / last_frame: at most one each; reference_image: at most 9. first_frame / last_frame cannot be combined with reference_* in one request (400)."}}},"CreateVideoGenerationRequest":{"type":"object","required":["model","content"],"properties":{"model":{"type":"string","enum":["MiniMax-H3-Max","MiniMax-H3"],"default":"MiniMax-H3-Max","description":"MiniMax-H3-Max is recommended; MiniMax-H3 is accepted and echoed back as sent."},"content":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ContentItem"},"description":"Must contain at least one non-empty text item (the prompt)."},"resolution":{"type":"string","enum":["480P","720P","768P","2K","1080P"],"default":"720P","description":"2K is delivered at 2560×1440. 1080P is accepted and delivered as 2K at the same price."},"duration":{"type":"integer","minimum":4,"maximum":30,"default":5,"description":"Whole seconds. Deliverable range is 5–30; a request of 4 is delivered and billed as 5. For 16–30 s (long video) last_frame is ignored and reference media are capped (8 images / 2 videos / 2 audio clips); every change is reported in `adjustments`."},"ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16","adaptive","3:2","2:3"],"default":"adaptive","description":"adaptive follows the first frame (else the first reference image) and snaps to the nearest fixed ratio; for text-only requests it is 9:16."},"callback_url":{"type":"string","format":"uri","description":"Public http(s) URL. We POST {\"challenge\": \"...\"} on task creation and expect the same challenge echoed back within 3 seconds; afterwards we POST {\"task\": {...}} on every status change. Pushes carry no download link — query the task for one."},"extra":{"type":"object","properties":{"prompt_expansion_mode":{"type":"string","description":"Accepted for compatibility; ignored."}}}}},"CreateVideoGenerationResponse":{"type":"object","required":["task_id"],"properties":{"task_id":{"type":"string","description":"Digits only.","example":"1789383217076969"}}},"Task":{"type":"object","description":"A video generation task. Same shape in Query, List items and callback pushes.","required":["id","model","status","created_at","updated_at","resolution","duration","ratio","task_type","modality"],"properties":{"id":{"type":"string","description":"Task id (digits only).","example":"1789383217076969"},"model":{"type":"string","description":"The model name you sent when creating the task."},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"created_at":{"type":"integer","description":"Unix timestamp (seconds)."},"updated_at":{"type":"integer","description":"Unix timestamp (seconds) of the last status change."},"content":{"type":"object","description":"Only present when status is succeeded and the file is still retained.","properties":{"url":{"type":"string","format":"uri","description":"Signed download link for the MP4. Valid for a limited time; query the task again to get a fresh link. No Authorization header is needed to download."}}},"resolution":{"type":"string","enum":["480P","720P","768P","2K"],"description":"Resolution actually delivered (a 1080P request is delivered as 2K)."},"duration":{"type":"integer","description":"Duration actually delivered, in whole seconds."},"ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16","3:2","2:3"],"description":"Effective aspect ratio (adaptive has been resolved to a fixed ratio)."},"task_type":{"type":"string","const":"generation"},"modality":{"type":"string","const":"video"},"usage":{"type":"object","description":"Only present when status is succeeded. Billing basis.","properties":{"total_seconds":{"type":"integer"},"input_seconds":{"type":"integer","description":"Reference video seconds (billed at the delivered tier)."},"output_seconds":{"type":"integer","description":"Delivered seconds (= duration)."},"input_image_count":{"type":"integer"},"input_audio_seconds":{"type":"integer"}}},"error":{"type":"object","description":"Only present when status is failed. The pre-charge has been refunded.","properties":{"code":{"type":"string","enum":["generation_failed","dispatch_failed"]},"message":{"type":"string"}}},"adjustments":{"type":"array","description":"Extension field (not in the official API). Present only when we changed something about your request to deliver it. Each entry is one of a fixed set of English sentences; see the enum-like list in `x-adjustment-codes`.","items":{"type":"string"}}},"x-adjustment-codes":["last_frame ignored for long video (reference-to-video mode)","reference videos capped at 2 for long video","reference audio clips capped at 2 for long video","reference images capped at 8 for long video","resolution 1080P -> 2K (delivered at 2560x1440, same price)","duration 4s -> 5s (shortest deliverable clip is 5s)"]},"UpscaleTask":{"type":"object","required":["id","model","status","created_at","updated_at","resolution","task_type","modality","source"],"properties":{"id":{"type":"string"},"model":{"type":"string","enum":["Maosika-Upscale"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"created_at":{"type":"integer","description":"Unix seconds."},"updated_at":{"type":"integer","description":"Unix seconds."},"resolution":{"type":"string","enum":["720P","1080P"]},"task_type":{"type":"string","enum":["upscale"]},"modality":{"type":"string","enum":["video"]},"source":{"type":"object","properties":{"type":{"type":"string","enum":["video_url","task"]},"task_id":{"type":"string","description":"Present when the source is a video generation task."}}},"input":{"type":"object","description":"The source video as read after download.","properties":{"width":{"type":"integer"},"height":{"type":"integer"},"duration":{"type":"number"},"fps":{"type":"string"}}},"output":{"type":"object","description":"Delivered size: the shorter side equals the resolution, the longer side follows the source aspect ratio.","properties":{"width":{"type":"integer"},"height":{"type":"integer"}}},"progress":{"type":"object","description":"While running: finished parts / total parts.","properties":{"done":{"type":"integer"},"total":{"type":"integer"}}},"content":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Signed download link (succeeded only)."}}},"usage":{"type":"object","properties":{"billable_seconds":{"type":"integer"}}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"CreateVideoUpscaleRequest":{"type":"object","description":"Provide exactly one of `video_url` or `source_task_id`.","properties":{"model":{"type":"string","enum":["Maosika-Upscale"],"default":"Maosika-Upscale"},"video_url":{"type":"string","format":"uri","description":"Public http(s) link to an MP4/MOV/WEBM video, up to 600 s. Its shorter side must be below the target resolution."},"source_task_id":{"type":"string","description":"A succeeded /v2/video_generation task of this account (within the retention window). No re-upload needed."},"resolution":{"type":"string","enum":["720P","1080P"],"default":"1080P"},"callback_url":{"type":"string","format":"uri","description":"Receives a POST with the task object on every status change (same challenge handshake as video generation)."}}}}}}