Create a video using an agent template
Table of contents
June 30, 2025
Create videos using MiniMax agent templates with predefined prompts and input requirements.
Use hailuoai.video account to generate videos, see Setup MiniMax for details.
To browse available templates use GET videos/agent-templates.
https://api.useapi.net/v1/minimax/videos/agent-create
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API token
is required, see Setup useapi.net for details.
Request Body
{
"account": "Optional MiniMax API account",
"templateId": "Required template ID",
"prompt": "Optional text prompt",
"fileID": "user:user_id-minimax:account-file:file_id",
"ossPath": "Optional OSS path for fileID",
"replyUrl": "Place your call back URL here",
"replyRef": "Place your reference id here",
"maxJobs": 1
}
-
account
is optional, if not specified API will randomly select account from available accounts. -
templateId
is required, the ID of the agent template to use. Get available templates from GET videos/agent-templates. -
prompt
is optional, text input for templates that require text prompts. Check template requirements using GET videos/agent-templates/?templateId=templateId
with the specifictemplateId
. fileID
is optional, required for templates that need image inputs:- fileID of image uploaded via POST /files
- fileID of previously uploaded image retrieved via GET /files
- fileID of previously uploaded character retrieved via GET videos/characters
- fileID of image generated via POST images/create.
-
ossPath
is required when usingfileID
, the OSS path / url for the uploaded file. -
replyUrl
is optional, if not provided value from useapi.net account will be used.
Place here your callback URL. API will call the providedreplyUrl
once MiniMax video completed or failed.
Maximum length 1024 characters. -
replyRef
is optional, place here your reference id which will be stored and returned along with this MiniMax video response / result.
Maximum length 1024 characters. maxJobs
is optional, if not specified value from accounts/account will be used.
Valid range: 1…10.
Responses
-
Use returned
videoId
to retrieve video status and results using GET /videos/videoId
.{ "projectID": "1122334455667788", "sectionID": "1122334455667799", "chatID": "1122334455667700", "videoId": "user:1234-minimax:987654321-video:998877665544332211", "replyUrl": "https://webhook.site/abc", "replyRef": "<your optional reference id>", "code": 200 }
-
{ "error": "<Error message>" }
-
{ "error": "Unauthorized" }
-
{ "error": "The video or template you are trying to use does not exist or has been deleted." }
Model
{ // TypeScript, all fields are optional
projectID: string
sectionID: string
chatID: string
videoId: string
replyUrl: string
replyRef: string
code: number
error: string
}
Examples
-
curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X POST "https://api.useapi.net/v1/minimax/videos/agent-create" \ -d '{"templateId": "…", "prompt": "…"}'
-
const templateId = "1122334455667788"; const prompt = "text prompt"; const apiUrl = `https://api.useapi.net/v1/minimax/videos/agent-create`; const token = "API token"; const data = { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' } }; data.body = JSON.stringify({ templateId, prompt }); const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result});
-
import requests template_id = "1122334455667788" prompt = "text prompt" apiUrl = f"https://api.useapi.net/v1/minimax/videos/agent-create" token = "API token" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } body = { "templateId": f"{template_id}", "prompt": f"{prompt}" } response = requests.post(apiUrl, headers=headers, json=body) print(response, response.json())