Video Generation
curl --request POST \
--url https://api.minimax.io/v1/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "A girl runs toward the camera and winks with a smile.",
"subject_reference": [
{
"type": "character",
"image": [
"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg"
]
}
],
"model": "S2V-01"
}
'{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Video Generation
Subject-Reference to Video Generation Task
POST
/
v1
/
video_generation
Video Generation
curl --request POST \
--url https://api.minimax.io/v1/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "A girl runs toward the camera and winks with a smile.",
"subject_reference": [
{
"type": "character",
"image": [
"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg"
]
}
],
"model": "S2V-01"
}
'{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Authorizations
HTTP: Bearer Auth
- Security Scheme Type: http
- HTTP Authorization Scheme:
Bearer API_key, can be found in Account Management>API Keys.
Headers
The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.
Available options:
application/json Body
application/json
Model name. Supported values: S2V-01.
Available options:
S2V-01 Subject reference images
Show child attributes
Show child attributes
Text description of the video, up to 2000 characters.
Whether to automatically optimize the prompt. Defaults to true. Set to false for more precise control.
A callback URL to receive asynchronous task status updates.
- Validation: Once configured, MiniMax sends a
POSTrequest with achallengefield. Your server must echo this value within 3s to validate. - Updates: After validation, MiniMax pushes status updates when the task changes. Response structure matches the Query Video Generation Task API.
Callback status values:
"processing"– Task in progress"success"– Task completed successfully"failed"– Task failed
from fastapi import FastAPI, HTTPException, Request
import json
app = FastAPI()
@app.post("/get_callback")
async def get_callback(request: Request):
try:
json_data = await request.json()
challenge = json_data.get("challenge")
if challenge is not None:
# Validation request, echo back challenge
return {"challenge": challenge}
else:
# Status update request, handle accordingly
# {
# "task_id": "115334141465231360",
# "status": "success",
# "file_id": "205258526306433",
# "base_resp": {
# "status_code": 0,
# "status_msg": "success"
# }
# }
return {"status": "success"}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
if __name__ == "__main__":
import uvicorn
uvicorn.run(
app, # Required
host="0.0.0.0", # Required
port=8000, # Required, port can be customized
# ssl_keyfile="yourname.yourDomainName.com.key", # Optional, enable if using SSL
# ssl_certfile="yourname.yourDomainName.com.key", # Optional, enable if using SSL
)⌘I