MiniMax Video Generation API Reference
The MiniMax Video Generation model supports text-to-video, image-to-video (first frame), image-to-video (last frame), image-to-video (first and last frames), and multimodal reference-to-video .
ImportantThis document applies only to the China (Beijing) region. Use an API key from this region.
Activate the Service
Go to the Alibaba Cloud Model Studio console, search for "MiniMax", find the MiniMax model card, click Enable Now, and confirm the activation and authorization in the pop-up window.
Applicable Scope
To ensure successful API calls, make sure that the model, Endpoint URL, and API Key all belong to the same region. Cross-region calls will fail.
- Select a model: Confirm the region to which the model belongs.
- Select a URL: Select the corresponding regional Endpoint URL. HTTP URLs are supported.
- Configure API Key: Select a region and Obtain an API key, then Configure API key as an environment variable.
HTTP Call
Since video generation tasks take a long time (typically 1-5 minutes), the API uses asynchronous calls. The entire process includes two core steps: "Create task -> Poll for results", as described below:
Step 1: Create a Task and Obtain the Task ID
Beijing region: POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Replace {WorkspaceId} with your actual workspace ID.
Note
- After the task is created successfully, use the
task_idreturned by the API to query the result. The task_id is valid for 24 hours. Do not create the task repeatedly; poll to obtain the result. - For beginner guidance, see Postman.
Request ParametersRequest HeadersContent-Type The content type of the request. Must be Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. X-DashScope-Async Asynchronous processing configuration parameter. HTTP requests support asynchronous mode only, and it must be set to ImportantIf this request header is missing, the error "current user api does not support synchronous calls" is returned. Request Bodymodel The model name. Valid values:
input The input information, such as prompts and media assets. parameters Video generation parameters, such as resolution, aspect ratio, and video duration. | |
Response Parametersoutput The task output information. request_id Unique request identifier for tracing and troubleshooting. code Error code. Returned only for failed requests. See Error codes. message Detailed error message. Returned only for failed requests. See Error codes. | Successful responseSave the task_id, which is used to query the task status and results. Error responseTask creation failed. See Error codes. |
Step 2: Query Results by Task ID
Beijing region: GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
Note
- Polling recommendation: Video generation typically takes several minutes. We recommend using a polling mechanism with a reasonable query interval (e.g., 15 seconds) to retrieve results.
- Task status flow: PENDING (queued) → RUNNING (processing) → SUCCEEDED (success) / FAILED (failure).
- task_id validity period: 24 hours. After expiration, the results cannot be queried, and the API will return a task status of
UNKNOWN. - RPS limit: The default RPS for the query API is 20. For higher-frequency queries or event notifications, we recommend Configure asynchronous task callbacks.
- More operations: For batch queries, task cancellation, and other operations, see Manage asynchronous tasks.
Request ParametersRequest HeadersAuthorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. URL Path Parameterstask_id The ID of the task. | Query Task ResultReplace |
Response Parametersoutput The task output information. usage Output statistics. Only counts successful results. request_id Unique request identifier for tracing and troubleshooting. | Task SucceededTask FailedIf the task execution fails, task_status will be set to FAILED, and an error code and message will be provided. See Error codes for troubleshooting. Task Query ExpiredThe task_id is valid for queries within 24 hours. After it expires, the query will no longer be available, and the following error message will be returned. |
Error codes
If the model call fails and returns an error message, see Error codes for resolution.