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.
application/json Body
The ID of the video template. For details on available IDs and required inputs, see Video Agent Template List.
An array of text inputs used to fill the text fields in the template. The requirements vary by template.
An array of media inputs (e.g., images) used to fill the media fields in the template. The requirements vary by template.
A callback URL to receive task status updates. You can configure this parameter to receive asynchronous notifications when the task status changes.
1. URL Verification: Once configured, the MiniMax server will send a POST request to the callback_url containing a challenge field. Your server must return the same challenge value within 3 seconds to complete verification.
2. Status Updates: After verification, MiniMax will push the latest task status to the callback URL whenever the task state changes. The pushed data structure is identical to the response body of the task query API.
The status field in the callback includes the following states:
processing- In progresssuccess- Completed successfullyfailed- Failed
Callback Service Example:
from fastapi import FastAPI, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
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:
# Verification request, return challenge as is
return {"challenge": challenge}
else:
# Callback request, handle your own logic here
# Example payload:
# {
# "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, can be customized
# ssl_keyfile="yourname.yourDomainName.com.key", # optional, enable SSL if needed
# ssl_certfile="yourname.yourDomainName.com.crt", # optional, enable SSL if needed
)





