AI Video API quickstart

Submit, poll, and retrieve a MiniMax H3 video without guessing field names.

Requirements

  • An AI Video Maker account and API key from Account → API Keys
  • The first API key created by an account grants 50 introductory API credits
  • Keep the key in AIVIDEO_API_KEY; do not put it in URLs, source code, analytics, or logs

API credits are separate from consumer website subscriptions. A website plan does not provide unlimited API generation.

Check setup

Use the non-billable doctor endpoint before the first generation. It validates the key and returns the current balance, key limits, credit warning, and supported models.

curl 'https://aivideomaker.ai/api/v1/account' \
  --header "key: $AIVIDEO_API_KEY"

Quote before spending

The quote endpoint validates the model fields and runs the same price calculation as generation without creating a task or charging credits. Media accessibility and content-safety checks run when you submit the protected generation request.

curl --request POST 'https://aivideomaker.ai/api/v1/quote/minimax' \
  --header 'Content-Type: application/json' \
  --header "key: $AIVIDEO_API_KEY" \
  --data '{"content":"A cinematic close-up of a candle on a wooden table.","duration":5,"resolution":"720p","tier":"turbo","aspectRatio":"16:9"}'

The response includes credits, listPriceUsd, currentBalance, affordable, and billable: false.

Submit a MiniMax H3 task

curl --request POST 'https://aivideomaker.ai/api/v1/generate/minimax' \
  --header 'Content-Type: application/json' \
  --header "key: $AIVIDEO_API_KEY" \
  --header 'Idempotency-Key: candle-demo-20260906-001' \
  --header 'X-Max-Credits: 15' \
  --data '{"content":"A cinematic close-up of a candle on a wooden table.","duration":5,"resolution":"720p","tier":"turbo","aspectRatio":"16:9"}'

A successful submission returns HTTP 200:

{
  "status": "SUBMITTED",
  "taskId": "ckxxxxxxxx",
  "creditsCharged": 15,
  "idempotentReplay": false,
  "responseUrl": "https://aivideomaker.ai/api/v1/tasks/ckxxxxxxxx",
  "statusUrl": "https://aivideomaker.ai/api/v1/tasks/ckxxxxxxxx/status",
  "cancelUrl": "https://aivideomaker.ai/api/v1/tasks/ckxxxxxxxx/cancel"
}

Creation requests are billable. Reuse the same Idempotency-Key only for an identical logical request; an identical retry returns the original task without a second charge. Reusing the key with different inputs returns HTTP 409. X-Max-Credits rejects the request before billing when the authoritative cost exceeds the caller-approved limit.

Poll status

curl 'https://aivideomaker.ai/api/v1/tasks/ckxxxxxxxx/status' \
  --header "key: $AIVIDEO_API_KEY"

Possible status values are SUBMITTED, PROGRESS, COMPLETED, FAILED, and CANCEL. Task query endpoints share a limit of 60 requests per minute per IP. Honor HTTP 429 and its Retry-After header.

Retrieve the video

After the status is COMPLETED, request task details:

curl 'https://aivideomaker.ai/api/v1/tasks/ckxxxxxxxx' \
  --header "key: $AIVIDEO_API_KEY"
{
  "id": "ckxxxxxxxx",
  "model": "minimax",
  "status": "COMPLETED",
  "output": {
    "url": "https://example.com/generated-video.mp4",
    "msg": "The file will only be saved for 24 hours, please download it promptly."
  },
  "completedAt": "2026-09-05T12:00:00.000Z"
}

Download completed output promptly. The current task response states that the file is retained for 24 hours.

Pricing

One API credit is USD $0.01. MiniMax H3 costs $0.03/second at 720p Turbo, $0.04/second at 720p Base or 1080p Turbo, and $0.05/second at 1080p Base. A 5-second 720p Turbo clip is 15 credits ($0.15); a 10-second clip is 30 credits ($0.30). See the MiniMax H3 contract.