happyhorse-1.1-r2v
依據參考圖片與文字腳本生成影片的模型。協助在新場景中維持角色外觀、物件及視覺風格。
- Ailoot · 影片
POST /v1/videos/generationshappyhorse-1.1-r2v - Ailoot · 影片
POST /v1/videos/generationshappyhorse-r2v - Ailoot · 影片
POST /v1/videos/generationshappyhorse-r2v-latest
關於模型
此說明介紹模型的能力。Ailoot 可用的輸入、輸出與選項,依所選方法列於下方。
HappyHorse-1.1-R2V 依據參考圖片與文字任務描述建立新的影片場景。Alibaba 將模型的設計重點放在生成動作時,保留可辨識的角色、物件及視覺風格。參考圖決定場景內容與外觀,文字則描述這些元素應如何互動。
視覺參考素材的用途
可使用一至九張圖片。它們可以設定角色、物件、環境或藝術呈現方式。描述中可指明參考圖的編號及其中的特定物件,把視覺素材連結到所需動作的對應部分。需要把多張圖片的元素整合在同一構圖中時,這點尤其有用。
與使用起始影格的模式不同,此處的參考圖是新場景內容的依據。文字任務描述必填:它將物件外觀與動作、攝影機運動及整體場面安排連結起來。製造商著重視覺一致性與電影感的運動;結果仍是生成內容,而非將原始圖片剪輯在一起。
接受 JPEG、JPG、PNG 及 WEBP,每個檔案大小上限為 20 MB。圖片短邊不得小於 400 像素;建議使用 720P 或以上等級的素材。此模式的輸入明確由圖片與文字組成。
片長、畫面與聲音
結果儲存為 MP4,影格率為每秒 24 個影格。片長以整數設定,範圍為 3 至 15 秒。解析度可選 480P、720P 或 1080P;支援生成聲音。
可使用橫式、直式及正方形畫面:16:9、9:16、1:1、4:3、3:4、4:5、5:4、9:21 及 21:9。選擇畫面比例可預先決定新場景的構圖空間。
文字可使用任何語言。上限為 5000 個非中文字元或 2500 個中文字元,超出的部分會被捨棄。最重要的參考圖用途、動作及運動資訊應包含在此上限內。起始隨機種子可引導生成版本的相似程度,但不保證精確重現同一段影片。
Ailoot · 影片 POST /v1/videos/generations happyhorse-1.1-r2v
happyhorse-1.1-r2vhappyhorse-1.1-r2vhappyhorse-r2vhappyhorse-r2v-latest
入門
依據參考圖片與文字腳本生成影片的模型。協助在新場景中維持角色外觀、物件及視覺風格。
- 接受的輸入
- 文字 · 圖片
- 結果
- 影片
Ailoot 可用 · 輸入與方法
Ailoot · 影片 POST /v1/videos/generations
- 輸入
text,image- 輸出
video- 輸出格式
- mp4
| 欄位 | 類型 | 要求 | 值與限制 | 預設值 |
|---|---|---|---|---|
欄位model | 類型string | 要求必填 | 值與限制 happyhorse-1.1-r2v | 預設值— |
欄位prompt | 類型string | 要求必填 | 值與限制 長度下限: 1 | 預設值— |
欄位duration | 類型integer | 要求選填 | 值與限制 最小值: 3 最大值: 15 單位: 秒 | 預設值5 |
欄位resolution | 類型string | 要求選填 | 值與限制 480P, 720P, 1080P | 預設值720P |
欄位ratio | 類型string | 要求選填 | 值與限制 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 | 預設值16:9 |
欄位image_urls | 類型https_url|data_image_url[] | 要求必填 | 值與限制 項目數下限: 1 項目數上限: 9 解碼後位元組數上限: 20,971,520 MIME 類型: image/jpeg, image/png, image/webp | 預設值— |
輸入素材組合
reference_images_to_video · 必填: prompt, image_urls
方法參數與生命週期
| 參數 | 規格 |
|---|---|
參數content_type | 規格application/json |
參數required | 規格model, prompt, image_urls |
參數material_types | 規格text, image |
參數optional | 規格duration, resolution, ratio |
參數duration_integer_range | 規格3, 15 |
參數default_duration | 規格5 |
參數resolution | 規格480P, 720P, 1080P |
參數default_resolution | 規格720P |
參數ratio | 規格16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 |
參數ratio_must_omit | 規格false |
參數image_urls | 規格{"min_count":1,"max_count":9,"schemes":["https","data 中的點陣圖 base64 資料"],"max_data_image_bytes":20971520} |
生命週期: submit_once_poll_original
GET /v1/videos/{request_id}
GET /v1/videos/generations/{request_id}
GET /v1/videos/{request_id}/content
GET /v1/videos/generations/{request_id}/content
方法結構與 ID 均為精確值;供應商能力與准入狀態分開。
方案
Ailoot 方法費率
POST /v1/videos/generations- 輸出
- US$0.18 1080p 每秒
- 輸出
- US$0.07 480p 每秒
- 輸出
- US$0.14 720p 每秒
Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →
請求範例
Ailoot · 影片
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_URLS_FILE:?Set a JSON file containing your actual reference-image URLs}"
export AILOOT_IMAGE_URLS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-1.1-r2v", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
f=Path(os.environ["AILOOT_IMAGE_URLS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual reference URL JSON file")
urls=json.loads(f.read_text())
if not isinstance(urls,list) or not 1<=len(urls)<=9:raise SystemExit("Provide one to nine reference-image URLs")
for u in urls:
z=urlsplit(u) if isinstance(u,str) else None
if not z or z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Each reference must be an actual HTTPS image URL")
p["image_urls"]=urls
p["ratio"]="16:9"
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/videos/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
print(json.dumps(r))
PY_RESULT
接收並儲存結果
Ailoot · 影片
mp4
GET /v1/videos/{request_id}GET /v1/videos/generations/{request_id}GET /v1/videos/{request_id}/contentGET /v1/videos/generations/{request_id}/content
查看工作狀態
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o status.json
python3 - <<'PY_STATUS'
import json
from pathlib import Path
r=json.loads(Path("status.json").read_text())
print(json.dumps(r))
if r.get("status")=="completed":
for x in r.get("data",[]):print(x)
PY_STATUS
儲存所有已完成的素材
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_STATUS_FILE:?Set the actual completed status JSON file}"
export AILOOT_STATUS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
from urllib.parse import urlsplit,urljoin
f=Path(os.environ["AILOOT_STATUS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual completed status file")
r=json.loads(f.read_text())
if r.get("status")!="completed" or not isinstance(r.get("data"),list) or not r["data"]:raise SystemExit("Wait for a completed status with asset paths")
urls=[]
for x in r["data"]:
if not isinstance(x,str) or "\n" in x or "\r" in x:raise SystemExit("Invalid asset path")
u=urljoin("https://api.ailoot.ai",x)
z=urlsplit(u)
if z.scheme!="https" or z.netloc!="api.ailoot.ai" or z.username or z.password:raise SystemExit("Use the actual Ailoot asset paths from status")
urls.append(u)
Path("asset-urls.txt").write_text("\n".join(urls)+"\n")
PY_REQUEST
index=0
while IFS= read -r asset_url; do
curl --fail-with-body --silent --show-error "$asset_url" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o "video-${index}.mp4"
index=$((index + 1))
done < asset-urls.txt
其他內容讀取方式
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id/content" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o video.mp4
保留所有已完成的結果
請儲存每部已完成的影片或傳回的檔案,並從實際傳回的每個素材 URL 取得素材。
請保留每個回傳的資料項目/輸出索引。content_url 僅代表第一個輸出;請取得每個實際內容路徑/資產。不帶 index 的 GET 內容請求並不代表所有輸出。
需要檢查原始回應時
請讀取現有的原始作業;切勿重新提交傳送結果不明的請求。
回應欄位
| 欄位 | 類型 |
|---|---|
欄位id | 類型string |
欄位object | 類型string |
欄位model | 類型string |
欄位status | 類型string |
欄位content_url | 類型signed URL |
欄位data[] | 類型signed URL |
欄位usage | 類型object |
欄位result_pending_check | 類型boolean |
錯誤與後續步驟
| 回應 | 條件 | 下一步 |
|---|---|---|
回應400 · invalid_request_error | 條件必要欄位、素材表示方式或參數值無效 | 下一步提出新的建立請求前,先修正指定欄位。 |
回應409 · video_not_ready | 條件原始結果內容尚無法取得 | 下一步請輪詢原始回傳的 ID,並遵守 Retry-After。 |
回應server_error | 條件回傳的回應表示該作業或結果需要檢查 | 下一步保留原始回傳的作業/任務 ID、請求標頭與回應;繼續以支援的方式讀取該原始作業。請勿重新提交建立請求。 |
別名
模型別名
Ailoot happyhorse-1.1-r2v, happyhorse-r2v, happyhorse-r2v-latest
方法路徑別名
請使用上方列出的 API 方法路徑。
相關呼叫用 ID
Ailoot · 影片 POST /v1/videos/generations happyhorse-r2v
happyhorse-r2vhappyhorse-1.1-r2vhappyhorse-r2vhappyhorse-r2v-latest
入門
依據參考圖片與文字腳本生成影片的模型。協助在新場景中維持角色外觀、物件及視覺風格。
- 接受的輸入
- 文字 · 圖片
- 結果
- 影片
Ailoot 可用 · 輸入與方法
Ailoot · 影片 POST /v1/videos/generations
- 輸入
text,image- 輸出
video- 輸出格式
- mp4
| 欄位 | 類型 | 要求 | 值與限制 | 預設值 |
|---|---|---|---|---|
欄位model | 類型string | 要求必填 | 值與限制 happyhorse-r2v | 預設值— |
欄位prompt | 類型string | 要求必填 | 值與限制 長度下限: 1 | 預設值— |
欄位duration | 類型integer | 要求選填 | 值與限制 最小值: 3 最大值: 15 單位: 秒 | 預設值5 |
欄位resolution | 類型string | 要求選填 | 值與限制 480P, 720P, 1080P | 預設值720P |
欄位ratio | 類型string | 要求選填 | 值與限制 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 | 預設值16:9 |
欄位image_urls | 類型https_url|data_image_url[] | 要求必填 | 值與限制 項目數下限: 1 項目數上限: 9 解碼後位元組數上限: 20,971,520 MIME 類型: image/jpeg, image/png, image/webp | 預設值— |
輸入素材組合
reference_images_to_video · 必填: prompt, image_urls
方法參數與生命週期
| 參數 | 規格 |
|---|---|
參數material_types | 規格text, image |
參數required | 規格null |
參數optional_controls | 規格null |
生命週期: submit_once_poll_original
GET /v1/videos/{request_id}
GET /v1/videos/generations/{request_id}
GET /v1/videos/{request_id}/content
GET /v1/videos/generations/{request_id}/content
方法結構與 ID 均為精確值;供應商能力與准入狀態分開。
方案
Ailoot 方法費率
POST /v1/videos/generations- 輸出
- US$0.18 1080p 每秒
- 輸出
- US$0.07 480p 每秒
- 輸出
- US$0.14 720p 每秒
Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →
請求範例
Ailoot · 影片
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_URLS_FILE:?Set a JSON file containing your actual reference-image URLs}"
export AILOOT_IMAGE_URLS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-r2v", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
f=Path(os.environ["AILOOT_IMAGE_URLS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual reference URL JSON file")
urls=json.loads(f.read_text())
if not isinstance(urls,list) or not 1<=len(urls)<=9:raise SystemExit("Provide one to nine reference-image URLs")
for u in urls:
z=urlsplit(u) if isinstance(u,str) else None
if not z or z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Each reference must be an actual HTTPS image URL")
p["image_urls"]=urls
p["ratio"]="16:9"
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/videos/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
print(json.dumps(r))
PY_RESULT
接收並儲存結果
Ailoot · 影片
mp4
GET /v1/videos/{request_id}GET /v1/videos/generations/{request_id}GET /v1/videos/{request_id}/contentGET /v1/videos/generations/{request_id}/content
查看工作狀態
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o status.json
python3 - <<'PY_STATUS'
import json
from pathlib import Path
r=json.loads(Path("status.json").read_text())
print(json.dumps(r))
if r.get("status")=="completed":
for x in r.get("data",[]):print(x)
PY_STATUS
儲存所有已完成的素材
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_STATUS_FILE:?Set the actual completed status JSON file}"
export AILOOT_STATUS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
from urllib.parse import urlsplit,urljoin
f=Path(os.environ["AILOOT_STATUS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual completed status file")
r=json.loads(f.read_text())
if r.get("status")!="completed" or not isinstance(r.get("data"),list) or not r["data"]:raise SystemExit("Wait for a completed status with asset paths")
urls=[]
for x in r["data"]:
if not isinstance(x,str) or "\n" in x or "\r" in x:raise SystemExit("Invalid asset path")
u=urljoin("https://api.ailoot.ai",x)
z=urlsplit(u)
if z.scheme!="https" or z.netloc!="api.ailoot.ai" or z.username or z.password:raise SystemExit("Use the actual Ailoot asset paths from status")
urls.append(u)
Path("asset-urls.txt").write_text("\n".join(urls)+"\n")
PY_REQUEST
index=0
while IFS= read -r asset_url; do
curl --fail-with-body --silent --show-error "$asset_url" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o "video-${index}.mp4"
index=$((index + 1))
done < asset-urls.txt
其他內容讀取方式
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id/content" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o video.mp4
保留所有已完成的結果
請儲存每部已完成的影片或傳回的檔案,並從實際傳回的每個素材 URL 取得素材。
請保留每個回傳的資料項目/輸出索引。content_url 僅代表第一個輸出;請取得每個實際內容路徑/資產。不帶 index 的 GET 內容請求並不代表所有輸出。
需要檢查原始回應時
請讀取現有的原始作業;切勿重新提交傳送結果不明的請求。
回應欄位
| 欄位 | 類型 |
|---|---|
欄位id | 類型string |
欄位object | 類型string |
欄位model | 類型string |
欄位status | 類型string |
欄位content_url | 類型signed URL |
欄位data[] | 類型signed URL |
欄位usage | 類型object |
欄位result_pending_check | 類型boolean |
錯誤與後續步驟
| 回應 | 條件 | 下一步 |
|---|---|---|
回應400 · invalid_request_error | 條件必要欄位、素材表示方式或參數值無效 | 下一步提出新的建立請求前,先修正指定欄位。 |
回應409 · video_not_ready | 條件原始結果內容尚無法取得 | 下一步請輪詢原始回傳的 ID,並遵守 Retry-After。 |
回應server_error | 條件回傳的回應表示該作業或結果需要檢查 | 下一步保留原始回傳的作業/任務 ID、請求標頭與回應;繼續以支援的方式讀取該原始作業。請勿重新提交建立請求。 |
別名
模型別名
Ailoot happyhorse-1.1-r2v, happyhorse-r2v, happyhorse-r2v-latest
方法路徑別名
請使用上方列出的 API 方法路徑。
相關呼叫用 ID
Ailoot · 影片 POST /v1/videos/generations happyhorse-r2v-latest
happyhorse-r2v-latesthappyhorse-1.1-r2vhappyhorse-r2vhappyhorse-r2v-latest
入門
依據參考圖片與文字腳本生成影片的模型。協助在新場景中維持角色外觀、物件及視覺風格。
- 接受的輸入
- 文字 · 圖片
- 結果
- 影片
Ailoot 可用 · 輸入與方法
Ailoot · 影片 POST /v1/videos/generations
- 輸入
text,image- 輸出
video- 輸出格式
- mp4
| 欄位 | 類型 | 要求 | 值與限制 | 預設值 |
|---|---|---|---|---|
欄位model | 類型string | 要求必填 | 值與限制 happyhorse-r2v-latest | 預設值— |
欄位prompt | 類型string | 要求必填 | 值與限制 長度下限: 1 | 預設值— |
欄位duration | 類型integer | 要求選填 | 值與限制 最小值: 3 最大值: 15 單位: 秒 | 預設值5 |
欄位resolution | 類型string | 要求選填 | 值與限制 480P, 720P, 1080P | 預設值720P |
欄位ratio | 類型string | 要求選填 | 值與限制 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 | 預設值16:9 |
欄位image_urls | 類型https_url|data_image_url[] | 要求必填 | 值與限制 項目數下限: 1 項目數上限: 9 解碼後位元組數上限: 20,971,520 MIME 類型: image/jpeg, image/png, image/webp | 預設值— |
輸入素材組合
reference_images_to_video · 必填: prompt, image_urls
方法參數與生命週期
| 參數 | 規格 |
|---|---|
參數material_types | 規格text, image |
參數required | 規格null |
參數optional_controls | 規格null |
生命週期: submit_once_poll_original
GET /v1/videos/{request_id}
GET /v1/videos/generations/{request_id}
GET /v1/videos/{request_id}/content
GET /v1/videos/generations/{request_id}/content
方法結構與 ID 均為精確值;供應商能力與准入狀態分開。
方案
Ailoot 方法費率
POST /v1/videos/generations- 輸出
- US$0.18 1080p 每秒
- 輸出
- US$0.07 480p 每秒
- 輸出
- US$0.14 720p 每秒
Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →
請求範例
Ailoot · 影片
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_URLS_FILE:?Set a JSON file containing your actual reference-image URLs}"
export AILOOT_IMAGE_URLS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-r2v-latest", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
f=Path(os.environ["AILOOT_IMAGE_URLS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual reference URL JSON file")
urls=json.loads(f.read_text())
if not isinstance(urls,list) or not 1<=len(urls)<=9:raise SystemExit("Provide one to nine reference-image URLs")
for u in urls:
z=urlsplit(u) if isinstance(u,str) else None
if not z or z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Each reference must be an actual HTTPS image URL")
p["image_urls"]=urls
p["ratio"]="16:9"
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/videos/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
print(json.dumps(r))
PY_RESULT
接收並儲存結果
Ailoot · 影片
mp4
GET /v1/videos/{request_id}GET /v1/videos/generations/{request_id}GET /v1/videos/{request_id}/contentGET /v1/videos/generations/{request_id}/content
查看工作狀態
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o status.json
python3 - <<'PY_STATUS'
import json
from pathlib import Path
r=json.loads(Path("status.json").read_text())
print(json.dumps(r))
if r.get("status")=="completed":
for x in r.get("data",[]):print(x)
PY_STATUS
儲存所有已完成的素材
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_STATUS_FILE:?Set the actual completed status JSON file}"
export AILOOT_STATUS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
from urllib.parse import urlsplit,urljoin
f=Path(os.environ["AILOOT_STATUS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual completed status file")
r=json.loads(f.read_text())
if r.get("status")!="completed" or not isinstance(r.get("data"),list) or not r["data"]:raise SystemExit("Wait for a completed status with asset paths")
urls=[]
for x in r["data"]:
if not isinstance(x,str) or "\n" in x or "\r" in x:raise SystemExit("Invalid asset path")
u=urljoin("https://api.ailoot.ai",x)
z=urlsplit(u)
if z.scheme!="https" or z.netloc!="api.ailoot.ai" or z.username or z.password:raise SystemExit("Use the actual Ailoot asset paths from status")
urls.append(u)
Path("asset-urls.txt").write_text("\n".join(urls)+"\n")
PY_REQUEST
index=0
while IFS= read -r asset_url; do
curl --fail-with-body --silent --show-error "$asset_url" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o "video-${index}.mp4"
index=$((index + 1))
done < asset-urls.txt
其他內容讀取方式
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id/content" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o video.mp4
保留所有已完成的結果
請儲存每部已完成的影片或傳回的檔案,並從實際傳回的每個素材 URL 取得素材。
請保留每個回傳的資料項目/輸出索引。content_url 僅代表第一個輸出;請取得每個實際內容路徑/資產。不帶 index 的 GET 內容請求並不代表所有輸出。
需要檢查原始回應時
請讀取現有的原始作業;切勿重新提交傳送結果不明的請求。
回應欄位
| 欄位 | 類型 |
|---|---|
欄位id | 類型string |
欄位object | 類型string |
欄位model | 類型string |
欄位status | 類型string |
欄位content_url | 類型signed URL |
欄位data[] | 類型signed URL |
欄位usage | 類型object |
欄位result_pending_check | 類型boolean |
錯誤與後續步驟
| 回應 | 條件 | 下一步 |
|---|---|---|
回應400 · invalid_request_error | 條件必要欄位、素材表示方式或參數值無效 | 下一步提出新的建立請求前,先修正指定欄位。 |
回應409 · video_not_ready | 條件原始結果內容尚無法取得 | 下一步請輪詢原始回傳的 ID,並遵守 Retry-After。 |
回應server_error | 條件回傳的回應表示該作業或結果需要檢查 | 下一步保留原始回傳的作業/任務 ID、請求標頭與回應;繼續以支援的方式讀取該原始作業。請勿重新提交建立請求。 |
別名
模型別名
Ailoot happyhorse-1.1-r2v, happyhorse-r2v, happyhorse-r2v-latest
方法路徑別名
請使用上方列出的 API 方法路徑。
相關呼叫用 ID
FAQ · happyhorse-1.1-r2v
- 可以使用哪些輸入與結果?
POST /v1/videos/generations·happyhorse-1.1-r2v:text,image→videoPOST /v1/videos/generations·happyhorse-r2v:text,image→videoPOST /v1/videos/generations·happyhorse-r2v-latest:text,image→video- 請求使用哪些欄位?
POST /v1/videos/generations·happyhorse-1.1-r2v:model,prompt,duration,resolution,ratio,image_urlsPOST /v1/videos/generations·happyhorse-r2v:model,prompt,duration,resolution,ratio,image_urlsPOST /v1/videos/generations·happyhorse-r2v-latest:model,prompt,duration,resolution,ratio,image_urls- 適用哪些限制?
POST /v1/videos/generations·happyhorse-1.1-r2v:duration.minimum:3;duration.maximum:15POST /v1/videos/generations·happyhorse-r2v:duration.minimum:3;duration.maximum:15POST /v1/videos/generations·happyhorse-r2v-latest:duration.minimum:3;duration.maximum:15