tutorial5 min read

The MiniMax H3 Prompting Guide: How to Craft Cinematic Camera Movements via API

Developer guide to writing cinematic camera-movement prompts for the MiniMax H3 video API on ToAPIs, including reusable templates, cURL/Python examples, and the current frontend request contract.

ToAPIs Engineering & Evaluation Team
TL;DR - Key Takeaways
  • Write one scene, one primary action, then add camera direction, lens, and lighting as plain prompt text.
  • Bracketed tags such as [Pan Left] or [Dolly In] are useful prompt helpers; the ToAPIs frontend contract does not define them as native H3 commands.
  • Base MiniMax H3 accepts integer durations of 4–15 seconds on POST /v1/videos/generations; use the field name ratio, not aspect_ratio.
  • Confirm the exact model ID, current account pricing, and response schema before you automate a shot list.

The MiniMax H3 Prompting Guide: How to Craft Cinematic Camera Movements via API

Target Model: minimax-h3
Inference Endpoint: https://api.toapis.com/v1/videos/generations
Related: MiniMax H3 API Guide · H3 vs Turbo selection · Automated R2V pipeline


1. TL;DR & Performance Overview

  • Job: Turn a shot list into repeatable MiniMax H3 prompts — subject, action, camera path, lens, and lighting — then submit them on the ToAPIs generations endpoint.
  • Prompt craft: Lead with camera intent, then the subject. Pair a directional phrase with a focal length (for example 35mm versus 85mm) and a lighting cue.
  • Contract: Base minimax-h3 accepts integer 4–15s clips. Use ratio (16:9, 9:16, and the other ratios listed below). This is the frontend request contract, not a latency or quality benchmark.
  • Syntax caution: Bracketed tags are prompt helpers. Do not treat [Pan Left] as a documented native command unless upstream model documentation says so.
  • Protocol: Bearer REST. Submit once, persist the task identifier, and poll the documented task-status endpoint with a bounded deadline.

2. Camera-Movement Prompt Patterns

A useful H3 prompt describes one scene and one primary action before it adds camera direction, lens, or style. Keep those pieces stable when you A/B a model or a duration; otherwise a wording change can explain a different take.

The tags in the table below are prompt helpers, not a guaranteed command grammar. The ToAPIs frontend contract validates the prompt as text (up to 7,000 Unicode characters). It does not establish that strings such as [Pan Left] are native H3 commands. Use them as a consistent vocabulary in your templates, then review the output.

Prompt helperVisual trajectoryTypical use
[Pan Left] / [Pan Right]Horizontal rotation on a fixed axisLandscape reveals, skyline sweeps
[Tilt Up] / [Tilt Down]Vertical tilt from a fixed positionTowers, tall subjects, sky reveals
[Dolly In] / [Dolly Out]Camera moves toward or away from the subjectTightening emotional emphasis
[Truck Left] / [Truck Right]Lateral tracking moveRunning alongside a vehicle or walker
[Crane Shot] / [Pedestal Up]Vertical elevation of the cameraHigh-angle establishing shots
[Orbit 180] / [Arc Shot]Semi-circular move around the subjectProduct turns, hero reveals
[Hitchcock Zoom]Dolly in while zooming out (or the reverse)Psychological shock, sudden realization

Abstract camera trajectories around a subject node

Figure 1: Treat pan, tilt, dolly, and orbit as prompt-space trajectories around one subject — then submit a single generation request through the ToAPIs gateway.

A compact template that stays testable:

text
[CAMERA] SUBJECT and ACTION, LIGHTING, shot on LENS, STYLE NOTES

Example: [Orbit 180 + Slow Dolly In] Matte black mechanical wristwatch resting on volcanic stone, moody low-key rim lighting, subtle steam haze, shot on 85mm macro lens, photorealistic, cinematic motion blur.

For first-frame (R2V) jobs, the same prompt language describes how the camera should move around or away from the anchor image. See the R2V pipeline tutorial for the request fields. Frame inputs and reference media remain mutually exclusive modes.

Supported ratio values in the current frontend are adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, and 9:16. Frame inputs force adaptive. Do not send aspect_ratio; the contract field is ratio.


3. Production Implementation: cURL & Python

Step 1: cURL dispatch

bash
curl -X POST "https://api.toapis.com/v1/videos/generations" \
  -H "Authorization: Bearer $TOAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-h3",
    "prompt": "[Orbit 180 + Slow Dolly In] Matte black mechanical wristwatch resting on volcanic stone, moody low-key rim lighting, subtle steam haze, shot on 85mm macro lens, photorealistic, cinematic motion blur",
    "duration": 6,
    "ratio": "16:9"
  }'

Step 2: Python prompt helper and poller

Match field names and the response envelope to the API reference for your account. The snippet below uses the task-status path also shown in other ToAPIs video guides; confirm task_id, status, and video_url against that schema before you ship.

python
import os
import time
import requests

API_KEY = os.environ["TOAPIS_API_KEY"]
ENDPOINT = "https://api.toapis.com/v1/videos/generations"
HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
}


def build_cinematic_prompt(
    subject: str,
    camera_move: str,
    lighting: str,
    lens: str = "35mm anamorphic",
) -> str:
    return (
        f"[{camera_move}] {subject}, {lighting}, "
        f"shot on {lens}, photorealistic, cinematic motion blur."
    )


def dispatch_camera_shot(prompt: str, duration: int = 6, ratio: str = "16:9") -> str:
    payload = {
        "model": "minimax-h3",
        "prompt": prompt,
        "duration": duration,
        "ratio": ratio,
    }
    res = requests.post(ENDPOINT, headers=HEADERS, json=payload, timeout=30)
    res.raise_for_status()
    data = res.json()
    task_id = data.get("task_id") or data.get("id")
    if not task_id:
        raise RuntimeError(f"Unexpected submission envelope: {data}")
    return task_id


def poll_task(task_id: str, deadline_s: int = 180) -> str:
    poll_url = f"https://api.toapis.com/v1/videos/tasks/{task_id}"
    interval = 3.0
    start = time.time()
    while time.time() - start < deadline_s:
        time.sleep(interval)
        poll = requests.get(poll_url, headers=HEADERS, timeout=15)
        poll.raise_for_status()
        data = poll.json()
        status = data.get("status")
        if status in {"succeeded", "success"}:
            return data["video_url"]
        if status in {"failed", "error"}:
            raise RuntimeError(f"Generation failed: {data.get('error')}")
        interval = min(interval * 1.5, 8.0)
    raise TimeoutError(f"Task {task_id} exceeded {deadline_s}s; check status before retrying")


if __name__ == "__main__":
    prompt = build_cinematic_prompt(
        subject="Matte black mechanical wristwatch resting on volcanic stone",
        camera_move="Orbit 180 + Slow Dolly In",
        lighting="Moody low-key rim lighting, subtle steam haze",
        lens="85mm macro lens",
    )
    task_id = dispatch_camera_shot(prompt)
    print("Task:", task_id)
    print("Video:", poll_task(task_id))

Store the prompt template version next to the task record so you can tell a model change from a wording change. A client-side timeout is not proof that the upstream task failed — check status before submitting a second billable job.

Base H3 duration is an integer from 4 to 15 seconds. Max-family IDs start at 5 seconds and have their own resolution lists; Turbo does not accept reference media. See the API guide before you switch IDs.


4. Error Handling & Status Matrix

The categories below are diagnostic starting points, not a guarantee of exact ToAPIs error codes.

HTTP statusCommon categoryRecommended action
400Invalid field, unsupported value, or media-mode conflictCheck model ID, duration, ratio, resolution, and that frame inputs are not mixed with reference media
401Missing or invalid API keyRotate the key in the ToAPIs dashboard and confirm the Authorization header
429Rate or concurrency limitBack off with jitter; retry only when safe
5xx or network timeoutTemporary gateway or upstream issueCheck task status before resubmitting; use a bounded retry policy

WaitTime=min⁡(MaxWait,BaseInterval×2attempt)+Uniform(0,1)\text{WaitTime} = \min(\text{MaxWait}, \text{BaseInterval} \times 2^{\text{attempt}}) + \text{Uniform}(0, 1)


5. Pricing & FinOps ROI

Estimated cost=successful output seconds×current account rate per second\text{Estimated cost} = \text{successful output seconds} \times \text{current account rate per second}

  • Do not reuse planning-draft unit prices. Per-second rates, billing units, and failed-task treatment vary by model, route, and account. Read the current ToAPIs catalog and your account quote before you forecast a shot list.
  • Official vendor contracts often add annual commitments, seat quotas, and prepayment floors. ToAPIs billing is typically pay-as-you-go — confirm the active terms on your account.
  • Control spend in the prompt layer: keep a versioned template, change one variable at a time, and avoid resubmitting after a client timeout until you have checked task status.
  • For variant trade-offs (base H3, canonical Max, Turbo), use the selection guide rather than an unverified speed or quality score.

6. Frequently Asked Questions

See the FAQ block in frontmatter. Summary: lead the prompt with camera intent; compound camera language is prompt text, not a guaranteed grammar; the same wording applies in first-frame mode; bracketed tags are not official API parameters.


7. Action Checklist

Explore Models Mentioned in This Post

MiniMaxVIDEO

minimax-h3

Current Rate: 20.8 credits /second
MiniMaxVIDEO

minimax-h3-max

Current Rate: 8 credits /second
ToAPIsAI Model

minimax-h3-max-turbo

Current Rate: View Live Pricing

Related Articles

tutorial10 min read

MiniMax H3 API Guide: Text-to-Video and Reference Inputs

A practical guide to calling MiniMax H3 video models through ToAPIs, with request examples, supported input modes, model-specific limits, and polling guidance.

TO
ToAPIs Engineering Team
#MiniMax H3