Text to Video Generation
Use this API to create a video generation task from text input.
Endpoint
| Method | URL |
|---|---|
| POST | https://neolink.com/api/minimax/v1/video_generation |
Authentication
| Type | Description |
|---|---|
| Bearer Token | Include Authorization: Bearer <API_key> in the request header for account verification. |
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Yes | Set request media type to application/json |
Authorization | string | Yes | Bearer API_key, used for account verification |
Request Body
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model name. Available value: MiniMax-Hailuo-2.3 |
prompt | string | Yes | - | Text description of the video, up to 2000 characters. Supports [command] syntax for camera control |
prompt_optimizer | boolean | No | true | Whether to automatically optimize prompt. Set to false for more precise control |
fast_pretreatment | boolean | No | false | Whether to shorten prompt_optimizer optimization time. Only effective for MiniMax-Hailuo-2.3 and MiniMax-Hailuo-02 models |
duration | integer | No | 6 | Video duration in seconds. Available values depend on model and resolution (see below) |
resolution | string | No | 768P | Video resolution. Options: 768P, 1080P (see below) |
callback_url | string | No | - | Callback URL to receive task status update notifications (see below) |
aigc_watermark | boolean | No | false | Whether to add watermark to generated video |
Camera Commands
Add camera commands in prompt using [command] format for precise lens control.
15 supported camera commands:
| Category | Commands |
|---|---|
| Pan left/right | [Pan Left], [Pan Right] |
| Tilt left/right | [Tilt Left], [Tilt Right] |
| Dolly | [Dolly In], [Dolly Out] |
| Pedestal | [Pedestal Up], [Pedestal Down] |
| Tilt up/down | [Tilt Up], [Tilt Down] |
| Zoom | [Zoom In], [Zoom Out] |
| Others | [Shake], [Follow], [Static] |
Usage rules:
- Combined: Multiple commands in same
[]execute simultaneously, e.g.[Tilt Left, Pedestal Up], recommend no more than 3 - Sequential: Commands appearing in order execute sequentially, e.g.
...[Dolly In], then...[Dolly Out] - Natural language: Also supports natural language camera descriptions, but standard commands give more accurate results
Duration Availability
| Model | 720P | 768P | 1080P |
|---|---|---|---|
| MiniMax-Hailuo-2.3 | - | 6 or 10 | 6 |
| MiniMax-Hailuo-02 | - | 6 or 10 | 6 |
| Other models | 6 | - | 6 |
Resolution Availability
| Model | 6s | 10s |
|---|---|---|
| MiniMax-Hailuo-2.3 | 768P (default), 1080P | 768P (default) |
callback_url
Configure callback via callback_url parameter to receive async task status notifications.
Address verification: After configuration, the server sends a POST request to callback_url with a challenge field. Your server must return the same challenge value within 3 seconds to complete verification.
Status updates: After successful verification, latest task status will be pushed to this URL whenever status changes.
Callback returned status includes:
processing�� Generatingsuccess�� Successfailed�� Failed
Callback verification example (Python)
python
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, host="0.0.0.0", port=8000)Example Request
bash
curl -X POST "https://neolink.com/api/minimax/v1/video_generation" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_key>" \
-d '{
"model": "MiniMax-Hailuo-2.3",
"prompt": "A man picks up a book [Pedestal up], then reads [Static shot].",
"duration": 6,
"resolution": "1080P"
}'Response Body
| Name | Type | Description |
|---|---|---|
task_id | string | Video generation task ID, used to query task status later |
base_resp.status_code | integer | Status code, 0 indicates success |
base_resp.status_msg | string | Detailed error description |
Example Response
json
{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Error Codes
| Code | Description |
|---|---|
0 | Request successful |
1002 | Rate limited, please try again later |
1004 | Authentication failed, check API-Key |
1008 | Insufficient account balance |
1026 | Video description contains sensitive content, please adjust |
2013 | Invalid parameters, check input |
2049 | Invalid API Key, please check your API Key |
