768P or 2K resolution.
link-token uses an OpenAI-compatible video generation API. At the top level of the request body, include only
model and prompt. Place the MiniMax-H3 content, resolution, duration, ratio, callback_url, and aigc_watermark fields inside metadata.Prerequisites
Before you make a request, make sure you have the following information:Base URL
API endpoint:
https://link-token.cnAPI Key
A token generated in the link-token dashboard, such as
sk-xxxxxxxxxxxx1. Create a video generation job
Request information
/v1/video/generations
required
Create a MiniMax-H3 video generation job.
- Authentication:
Authorization: Bearer $YOUR_API_KEY - Content type:
application/json
Request body structure
Top-level parameters
string
required
The model name. Set it to
MiniMax-H3.string
required
Describe the video you want to generate. Both English and Chinese are supported. The value is appended to the text item in
metadata.content.object
required
The MiniMax-H3 generation parameters.
metadata parameters
content items
Thetype field identifies the input type of each item in metadata.content.
role values
2. Choose a generation mode
Text-to-video
For text-to-video generation,content contains only text. The ratio field is required and cannot be set to adaptive.
Image-to-video
In addition to text, provide a first-frame image, a last-frame image, or both. The input images determine the aspect ratio, so setratio to adaptive.
Multimodal reference-to-video
You can combine reference images, reference videos, and reference audio. You can omitratio to use the default value of adaptive, or explicitly specify a fixed aspect ratio.
3. Input media requirements
The entire request body must not exceed 64 MB. Base64 encoding typically increases the data size by approximately 33%. Use a public URL for larger media files. Media URLs support the following formats:- A publicly accessible HTTP or HTTPS URL.
- A Data URI for the corresponding media type, such as
data:image/png;base64,...,data:video/mp4;base64,..., ordata:audio/mp3;base64,....
Image limits
Video limits
Audio limits
4. Send a request
The following example creates a2K, 5-second, 16:9 text-to-video job.
Successful creation response
A successful creation response means the job has entered the asynchronous queue. It does not mean the video is complete.task_id. You must use this value exactly as returned for subsequent queries.
5. Query job status
Request information
/v1/video/generations/{task_id}
required
Query the job status and generation result.
string
required
The public link-token job ID returned when you created the job, such as
task_xxx.Successful response
HTTP status code:200
Response fields
Status mapping
Poll every 5 to 10 seconds. Use the outer
data.status field to determine whether the job is complete, and use data.result_url to get the final video URL.
Data before the first poll completes
Immediately after submission, before the first upstream poll completes,data.data might contain only the MiniMax upstream job ID returned during job creation:
task_id in the query URL with this upstream value.
Failed job response
When generation fails, the query endpoint still returns HTTP200, and the top-level code remains success. The failure status and reason are in the job object.
Job not found
If the job ID does not exist or does not belong to the current user, the endpoint returns HTTP400:
6. Callback notifications
When you providemetadata.callback_url, MiniMax first sends a verification request containing a challenge to that URL. Your service must return the same challenge within 3 seconds. After successful verification, MiniMax sends POST notifications to the URL when the job status changes.
Callbacks do not replace the query endpoint. Your service should still be able to query the job with task_id.
7. Error responses
The API uses OpenAI-style error objects and returns the corresponding HTTP status code.
Keep the
request_id from the response when you troubleshoot an issue.
