MiniMax H3 Optimised Reference to Video Serverless API
Keep characters and motion from reference images and video.
POST /v2/minimax-h3-optimised-reference-to-video · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "prompt": "Image 1 is the locomotive driver. On the footplate of a steam locomotive pounding along an open track, he leans out of the cab window, looks back along the train and says clearly, 'Right, she's holding pressure - take us up the bank.' Follow the camera movement from Video 1. The firebox throws an orange glow across his face, white steam streams past, and a moment later the whistle lets out a long shriek as the wheels hammer the rails. Medium shot from alongside the moving cab.",
11 "reference_images": ["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-optimised-r2v-driver-ref.jpg"],
12 "reference_video": "https://segmind-resources.s3.amazonaws.com/input/minimax-h3-optimised-r2v-camera-ref.mp4",
13 "resolution": "768p",
14 "duration": 5,
15 "aspect_ratio": "16:9",
16 "quality": "high",
17 "enhance_prompt": True,
18}
19job = client.submit_async("minimax-h3-optimised-reference-to-video", **payload)
20print(job.request_id) # available immediately
21try:
22 result = job.wait(timeout=900, interval=2.0)
23 print(result["status"]) # COMPLETED
24 print(result.get("output")) # model output (e.g. video URL)
25except InferenceTimeout as e:
26 print("still running:", e.request_id) # re-poll later with this id
27except InferenceFailed as e:
28 print("failed:", e.detail)
29
30# Fast models (<=600s) can use the one-liner instead:
31# result = segmind.run("minimax-h3-optimised-reference-to-video", **payload) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "prompt": "Image 1 is the locomotive driver. On the footplate of a steam locomotive pounding along an open track, he leans out of the cab window, looks back along the train and says clearly, 'Right, she's holding pressure - take us up the bank.' Follow the camera movement from Video 1. The firebox throws an orange glow across his face, white steam streams past, and a moment later the whistle lets out a long shriek as the wheels hammer the rails. Medium shot from alongside the moving cab.",
11 "reference_images": ["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-optimised-r2v-driver-ref.jpg"],
12 "reference_video": "https://segmind-resources.s3.amazonaws.com/input/minimax-h3-optimised-r2v-camera-ref.mp4",
13 "resolution": "768p",
14 "duration": 5,
15 "aspect_ratio": "16:9",
16 "quality": "high",
17 "enhance_prompt": True,
18}
19job = client.submit_async("minimax-h3-optimised-reference-to-video", **payload)
20print(job.request_id) # available immediately
21try:
22 result = job.wait(timeout=900, interval=2.0)
23 print(result["status"]) # COMPLETED
24 print(result.get("output")) # model output (e.g. video URL)
25except InferenceTimeout as e:
26 print("still running:", e.request_id) # re-poll later with this id
27except InferenceFailed as e:
28 print("failed:", e.detail)
29
30# Fast models (<=600s) can use the one-liner instead:
31# result = segmind.run("minimax-h3-optimised-reference-to-video", **payload)API Endpoint
https://api.segmind.com/v1/minimax-h3-optimised-reference-to-videoParameters
promptrequiredstringDescribe subject, action, camera, dialogue and sound, up to 7000 characters. Name references as Image 1-4 and Video 1.
"Image 1 is the woman in the red dress. She walks through a neon-lit night market, looking around in wonder"aspect_ratiooptionalstringOutput aspect ratio. Use 16:9 for widescreen, 9:16 for vertical, 21:9 for cinematic.
"16:9""16:9""9:16""1:1""4:3""3:4""21:9"durationoptionalintegerClip length in whole seconds, 5 to 15. Keep it short to hold lip-sync; extend it for a sequence.
5Range: 5 - 15enhance_promptoptionalbooleanExpands your prompt before rendering. Turn off to send it exactly as written.
truequalityoptionalstringhigh renders at full fidelity; low renders faster and looks nearly identical. Use high for finals.
"high""high""low"reference_imagesoptionalstring[]Up to 4 images that fix a character, product or scene, named Image 1-4. One clear portrait locks a face.
reference_videooptionalstring (uri)One optional clip, named Video 1, whose motion or camera movement the output follows. Use a clear camera move.
resolutionoptionalstringOutput resolution; 768p is generated natively while 1080p is upscaled from 540p and 2k from 768p. Keep 768p for most clips.
"768p""480p""768p""1080p""2k"seedoptionalintegerOptional seed for repeatable results. Reuse a value to reproduce a clip.
Response Type
Returns: Video
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/minimax-h3-optimised-reference-to-videoSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out