Skip to content

Text to Video Generation ​

Use this API to create a video generation task from text input.

Endpoint ​

MethodURL
POSThttps://neolink.com/api/minimax/v1/video_generation

Authentication ​

TypeDescription
Bearer TokenInclude Authorization: Bearer <API_key> in the request header for account verification.

Request Headers ​

NameTypeRequiredDescription
Content-TypestringYesSet request media type to application/json
AuthorizationstringYesBearer API_key, used for account verification

Request Body ​

NameTypeRequiredDefaultDescription
modelstringYes-Model name. Available value: MiniMax-Hailuo-2.3
promptstringYes-Text description of the video, up to 2000 characters. Supports [command] syntax for camera control
prompt_optimizerbooleanNotrueWhether to automatically optimize prompt. Set to false for more precise control
fast_pretreatmentbooleanNofalseWhether to shorten prompt_optimizer optimization time. Only effective for MiniMax-Hailuo-2.3 and MiniMax-Hailuo-02 models
durationintegerNo6Video duration in seconds. Available values depend on model and resolution (see below)
resolutionstringNo768PVideo resolution. Options: 768P, 1080P (see below)
callback_urlstringNo-Callback URL to receive task status update notifications (see below)
aigc_watermarkbooleanNofalseWhether to add watermark to generated video

Camera Commands ​

Add camera commands in prompt using [command] format for precise lens control.

15 supported camera commands:

CategoryCommands
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 ​

Model720P768P1080P
MiniMax-Hailuo-2.3-6 or 106
MiniMax-Hailuo-02-6 or 106
Other models6-6

Resolution Availability ​

Model6s10s
MiniMax-Hailuo-2.3768P (default), 1080P768P (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 �� Generating
  • success �� Success
  • failed �� 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 ​

NameTypeDescription
task_idstringVideo generation task ID, used to query task status later
base_resp.status_codeintegerStatus code, 0 indicates success
base_resp.status_msgstringDetailed error description

Example Response ​

json
{
  "task_id": "106916112212032",
  "base_resp": {
    "status_code": 0,
    "status_msg": "success"
  }
}

Error Codes ​

CodeDescription
0Request successful
1002Rate limited, please try again later
1004Authentication failed, check API-Key
1008Insufficient account balance
1026Video description contains sensitive content, please adjust
2013Invalid parameters, check input
2049Invalid API Key, please check your API Key