docs
API

Video and music

Markdown

Video and music generation: a request creates a task, and you retrieve its result using the task ID.

Full guide
POSThttps://api.ailoot.ai/v1/videos
Video and music
# Keep the Request ID: support uses it to find your request.
# Create the job once; the loop below only reads its status.
curl --fail-with-body --max-time 120 -D video-create-headers-v1.txt \
  https://api.ailoot.ai/v1/videos \
  -H "Authorization: Bearer $AILOOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"grok-imagine-video-1.5","prompt":"a calm lake","seconds":"8","size":"1280x720"}' \
  -o video-create-v1.json || exit 1
VIDEO_ID=$(jq -er '.id // .request_id' video-create-v1.json) || exit 1
VIDEO_STATUS=""
# This loop reads the original job only. It never resends the creation request.
for ATTEMPT in $(seq 1 60); do
  curl --fail-with-body --max-time 30 \
    "https://api.ailoot.ai/v1/videos/$VIDEO_ID" \
    -H "Authorization: Bearer $AILOOT_API_KEY" \
    -o video-status-v1.json || exit 1
  VIDEO_STATUS=$(jq -r '.status // empty' video-status-v1.json)
  # result_pending_check: true (status stays in_progress): the result is being checked. Stop; never create the job again.
  if jq -e '.result_pending_check == true' video-status-v1.json >/dev/null; then
    cat video-status-v1.json
    echo "The result is being checked. Do not create the job again: check GET /v1/videos/$VIDEO_ID later or contact support with the Request ID." >&2
    exit 1
  fi
  case "$VIDEO_STATUS" in
    done|completed) break ;;
    queued|in_progress|pending|processing) sleep 5 ;;
    # failed or any other status: show it and stop. Never create the job again.
    *) cat video-status-v1.json; exit 1 ;;
  esac
done
case "$VIDEO_STATUS" in
  done|completed) ;;
  *) echo "The job is not finished yet (status: ${VIDEO_STATUS:-none}). Check it later: GET /v1/videos/$VIDEO_ID" >&2; exit 1 ;;
esac
curl --fail-with-body --max-time 120 -L --max-redirs 3 \
  "https://api.ailoot.ai/v1/videos/$VIDEO_ID/content" \
  -H "Authorization: Bearer $AILOOT_API_KEY" -o video-v1.mp4
# After a create timeout, check the Request ID in your usage history before running this script again.
Response · abbreviated
// The job ID is in the id or request_id field
{ "id": "…", … }

// The format depends on the model: use the identifier
// from the creation response unchanged.

Authentication

  • Authorizationheaderrequired

    The key in the format Bearer sk-…. The following headers also work: x-api-key or x-goog-api-key.

Video: request body

  • modelstringrequired

    Video model: google/omni-1.1-flash, grok-imagine-video, happyhorse-1.1-t2v, MiniMax-Hailuo-2.3, grok-imagine-video-1.5, happyhorse-1.1-r2v, grok-imagine-video-1.5-preview, happyhorse-1.1-i2v.

  • promptstringrequired

    Video description.

  • duration / secondsinteger / stringoptional

    Depends on the model family: Grok 1–15 seconds; MiniMax 6/10 at 768P or 6 at 1080P; HappyHorse 3–15; Google Omni 4/6/8/10. Do not use a field from one family with another.

  • resolution / sizestringoptional

    Grok: 480p/720p/1080p (1080p for video-1.5), or size 1280x720/720x1280/1920x1080/1080x1920. MiniMax: 768P/1080P. HappyHorse: 480P/720P/1080P. Google Omni: 360p/720p.

  • image / first_frame_image / image_urlsstring / arrayoptional

    Source-image fields depend on the model family and mode. MiniMax Fast requires first_frame_image. HappyHorse t2v uses no images; i2v requires exactly one image with no ratio; r2v accepts 1–9 images.

The response contains the task ID (the id or request_id field). Use it as returned, without parsing it: its format depends on the model. To get the status and completed file:

GEThttps://api.ailoot.ai/v1/videos/{id}
GEThttps://api.ailoot.ai/v1/videos/{id}/content

The same URLs also work with the prefix /v1/videos/generations/{id}. The status of a completed task and the response fields depend on the model. Check the status field and retrieve the file through /content.

Create → check status → download

Save the creation response and its Request ID. For MiniMax/HappyHorse, the ready status is status: completed; the response contains content_url, data[] and usage. For Grok, it is status: done with video.url. Google Omni returns 202 queued, followed by in_progress with Retry-After, completed, or partial/content_revoked. A 200 response does not always mean the video is ready. If the status response contains result_pending_check: true (status is in_progress), the result is still being determined. Do not create the task again. Check it later through GET /v1/videos/{id}, or contact support with the Request ID.

/content may return an MP4 directly or redirect to a signed file. If the response contains multiple results in data[], save each one: all delivered results are billed. Video tasks cannot be cancelled or deleted through the API. Deleting a completed file removes access to it but does not cancel generation.

Billing is per second of completed video at the selected resolution, or per video, as listed in the catalog. The full cost is reserved when the task is created.

Music

POSThttps://api.ailoot.ai/v1/music/generations
  • modelstringrequired

    google/lyria, google/lyria-3-clip-preview.

  • promptstringrequired

    Track description: genre, instruments, and mood.

In the response, data[] contains links to the completed clips. A model may return several clips for one request; each delivered clip is billed.

Still have questions? Send your Request ID and a description — we'll help you troubleshoot.Contact support