XBAI API
Video Models

MiniMax H3

Text-to-video, first/last frames and multimodal references with 768p or 2K output.

POST/api/v1/jobs/createTask

Set model to hailuo-h3 for 5 to 15 seconds of 768p or 2K video. Save the returned taskId and query the result, or configure a customer callback.

Request example

cURL
curl -X POST https://api.xbaiapi.com/api/v1/jobs/createTask \
  -H "Authorization: Bearer xb-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "hailuo-h3",
    "input": {
      "prompt": "a cat stretching on a sunlit windowsill",
      "resolution": "768p",
      "duration": 5,
      "ratio": "16:9"
    },
    "callBackUrl": "https://your-server.com/webhook"
  }'

Parameters

FieldTypeRequiredNotes
modelstringYesFixed value hailuo-h3
input.promptstringConditionalVideo description; optional when a first frame is supplied
input.resolutionstringNo768p or 2K, case insensitive; defaults to 2K
input.durationnumberNoInteger from 5 to 15 seconds; defaults to 5
input.ratiostringNoadaptive, 16:9, 9:16, 1:1, 4:3, 3:4, 21:9. Defaults to adaptive; text-only input uses 16:9
input.firstFrameUrlstringNoFirst frame; cannot be combined with reference lists
input.lastFrameUrlstringNoLast frame; requires a first frame
input.imageUrlsstring[]NoUp to 9 reference images
input.videoUrlsstring[]NoUp to 3 MP4/MOV reference videos, 50 MB each
input.audioUrlsstring[]NoUp to 3 reference audio clips; input audio is free
callBackUrlstringNoCustomer HTTP(S) endpoint for terminal task notifications

Media must use publicly reachable HTTP(S) URLs. Reference videos must be MP4 or MOV files (not fragmented) at https URLs on a domain name that return the file directly (HTTP 200, no redirect) with Content-Length, up to 50 MB each. The server copies each reference video to xbaiapi storage, hands the copy to the upstream and bills the longest duration found in the file, including the actual frame timing. Videos that cannot be downloaded or measured return 422 before billing. Client-supplied duration is not used for billing. First/last frames cannot be combined with reference image, video or audio lists.

Billing

ResolutionInput and output video rateUSD per second
768p6.4 credits$0.032
2K10.4 credits$0.052

Total = rate × (output video seconds + input video seconds) + additional image cost.

Total input video duration is rounded up to a whole second. The first 5 images are free; each additional image costs 3.2 credits ($0.016). Input audio is free. Text-to-video, first/last frames and multimodal requests use the same resolution rate.

Example: 5 seconds of 768p output, 3 seconds of reference video and 7 reference images cost 6.4 × (5 + 3) + 3.2 × 2 = 57.6 credits, or $0.288. Failed tasks are refunded in full.

Response

Success response
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "xb_a1b2c3d4e5f6...",
    "creditsCharged": 32
  }
}

Task state is synchronized by scheduled polling, normally every 2 minutes. On success, resultJson.resultUrls in the query response contains the video URL. Results are retained for 30 days.

On this page