Source: https://ailoot.ai/docs/api/video-music/
Canonical: https://ailoot.ai/docs/en/api/video-music/
Language: en

[API](https://ailoot.ai/docs/en/) 

# Video and music

[Markdown](https://ailoot.ai/docs/en/api/video-music/index.md)

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

POST`https://api.ailoot.ai/v1/videos`

Video and music

```bash
# 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.
```

```bash
curl https://api.ailoot.ai/v1/music/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "google/lyria", "prompt": "Calm piano and cello, no vocals"}' 
```

Response · abbreviated

```json
// 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

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | header | required | The key in the format `Bearer sk-…`. The following headers also work: `x-api-key` or `x-goog-api-key`. |

## Video: request body

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `model` | string | required | 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`. |
| `prompt` | string | required | Video description. |
| `duration / seconds` | integer / string | optional | 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 / size` | string | optional | 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_urls` | string / array | optional | 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:

GET`https://api.ailoot.ai/v1/videos/{id}`

GET`https://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

POST`https://api.ailoot.ai/v1/music/generations`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `model` | string | required | `google/lyria`, `google/lyria-3-clip-preview`. |
| `prompt` | string | required | 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.

Do not resend a video or music request if the connection drops: the task may already have started. First check its status using the task ID, or contact support with the Request ID.

Still have questions? Send your Request ID and a description — we'll help you troubleshoot.[Contact support](mailto:support@ailoot.ai)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
