Quick Start
Video generation is an asynchronous operation. The whole process is divided into three steps:API Overview
Base URL:
https://aihubmix.com
Authentication: Bearer Token
Supported Models
Text-to-Video
Image-to-Video
Image-to-video requires passing the reference image via the
input_reference parameter (Alibaba Tongyi Wanxiang); Doubao Seedance passes it via the extra_body.content array, which supports image, video, and audio reference types; Kling uses image / image_tail / image_list to pass images — see the Kling section below for details.API Details
Request Headers
Create a Video Generation Task
Request Body
Response formats vary slightly across models, but all include theid(video_id) andstatusfields. Just usestatusto determine task progress.
Example Response (Tongyi Wanxiang / Veo / Jimeng AI)
Common Status Values
Query Video Status
Example Response (Generation Complete - Tongyi Wanxiang)
Example Response (Generation Complete - Sora)
All models usestatus == "completed"to determine the completion state, then call the/contentendpoint to download.
Download Video Content
completed, call this endpoint to download the MP4 video file.
Response: Returns the video binary stream directly (Content-Type: video/mp4).
Note: Video download links usually have a 24-hour validity period, so download and save them promptly.
Delete a Video Task
This endpoint is used to delete an already-created video task.Per-Model Parameter Details
OpenAI Sora
Tip: TheExamplesecondsparameter for all models is always passed as a string (e.g."8").
Google Veo
Example
Image field notes:
- First-frame precedence:
first_frame>input_reference(OpenAI-compatible single frame). - Each element of
first_frame/last_frame/reference_imagesaccepts: a public URL, a base64 data URL (data:image/png;base64,...), or a{"mime_type":"image/png","data":"<base64>"}object. - The OpenRouter-style
frame_images(elements withframe_type: first_frame | last_frame) andinput_referencesaliases are also accepted. - Up to 3 reference images; exceeding that returns 400.
Tip: Veo supports native audio generation; you can describe sound effects in the prompt, such as “the sound of birds chirping in the background” or “a piano melody”.
Tongyi Wanxiang
Duration Supported by Each Model
Supported Resolutions (width*height)
Note: wan2.6 supports only 720P and 1080P; wan2.5 supports 480P, 720P, and 1080P; wan2.2 supports only 480P and 1080P.Example
Tip: wan2.5 and above generate videos with sound by default (automatic dubbing); Chinese prompts work better.
Jimeng AI
Supported Aspect Ratios and Corresponding Resolutions
Example
Doubao Seedance
Reference Types Supported by
extra_body.content
Example
Seedance 2.0 / 2.0 Fast
Kling
Kling supports four types of capabilities: text-to-video, image-to-video, multi-image reference video, and OmniVideo multimodal. All are invoked through the unified/v1/videos endpoint, and the gateway automatically routes to the corresponding Kling endpoint based on “model name + input form”, with no need for the caller to differentiate.
Parameters
Unsupported or unmapped key parameters will raise an explicit error rather than being silently dropped. Other native Kling parameters can be placed in
extra_body to pass through to the upstream.- Three asynchronous steps: submit to get
video_id→ pollGET /v1/videos/{video_id}untilstatusiscompleted→GET /v1/videos/{video_id}/contentto download the MP4. Status values:in_progress/completed/failed. - Video output usually takes 1–3 minutes; result video URLs are cleaned up after 30 days, so transfer and save them promptly.
- Delete task: Kling has no delete endpoint;
DELETE /v1/videos/{video_id}returns501 not_supported. - Billing: charged by model ×
mode× duration × capability (with or without reference video / audio); no charge for failed generation, and queries and downloads are not billed.
Complete Invocation Examples
FAQ
How long does video generation take?
Video generation usually takes 1-5 minutes, depending on the model, resolution, and duration. We recommend setting a 15-second polling interval.How do I use the input_reference parameter?
input_reference is used in image-to-video scenarios and supports three ways of passing input:
How long is the video download link valid?
Generated video download links usually have a 24-hour validity period, so download and save them promptly.What are the differences in the seconds parameter across models?
> Tip: The
seconds parameter for all models is always passed as a string (e.g. "8"), and the API handles it automatically.
What are the differences in the size parameter format across models?
What is the difference between seconds and duration?
The two have the same meaning, both representing the video duration. The API supports both parameter names (except Sora, which only accepts seconds). We recommend using seconds consistently.
How do I write better prompts?
- Describe specific scenes: include subject, action, environment, lighting, atmosphere
- Specify camera language: such as “close-up”, “aerial shot”, “push-in shot”, “slow motion”
- Describe style: such as “cinematic”, “documentary style”, “animation style”
- Chinese models work better with Chinese prompts: Tongyi Wanxiang is optimized for Chinese
- Veo supports audio descriptions: you can describe sounds in the prompt, such as “birds chirping” or “a piano melody”
How do I handle a failed task?
Whenstatus is failed, the error field in the response contains error information: