HappyHorse 1.1 影片 API:面向高頻工作負載的輕量影片生成
目標型號:
happyhorse-1.1
推理端點:https://toapis.com/v1/videos/generations
相關閱讀:Vidu Q3 API 開發者指南 · Vidu Q3 Drama Mode API · Wan 2.6 圖生影片流水線 · HappyHorse 1.1 影片生成 · happyhorse-1.1 型號指南
1. TL;DR 與能力概覽
排期標題把 HappyHorse 1.1 定位為面向高頻工作負載的輕量生成器。在 2026-11-26 核對的頁面上,這是定位表述,不是可測量的 SLA。官方 HappyHorse 1.1 影片生成 參考(HTTP 200)文件化的是一套緊湊、基於 action 的合同——文生影片、圖生影片、參考圖生影片和影片編輯——時長窗口為 3–15 秒。它沒有文件化 10–14 秒出片、100 路並行、亞 12 秒延遲、99.95% SLA,或 loop: true 欄位。
已文件化的公共型號名是 happyhorse-1.1(帶點)。規劃稿別名 happyhorse-1-1 不是已文件化 ID。現網型號指南是 /model-guide/happyhorse-1-1(標題使用 happyhorse-1.1)。/model-guide/happyhorse-1.1 返回了 HTTP 404;/model-guide/happyhorse 是軟 404(「Model Guide Not Found」)。
已文件化的內容如下:
action—text-to-video、image-to-video、reference-to-video或video-edit。若省略action,帶有首幀圖表示圖生影片;否則請求為文生影片。- 時長 3–15 秒,預設 5。分辨率
720P或1080P,預設1080P(官方示例使用大寫P)。 - 鑑權與輪詢 —
Authorization: Bearer <API_KEY>。先POST /v1/videos/generations,再GET /v1/videos/generations/{task_id}(HappyHorse 頁面給出了這條路徑)。普通任務也可以用GET /v1/tasks/{id}查詢。官方示例使用https://toapis.com(中國大陸為https://toapis.cn)。completed後讀取result.data[0].url。影片保留 30 天。 - 價格 — 2026-11-26 的型號指南快照是 17.1428 credits/秒,高於
viduq3的 8.5714 credits/秒。不要把它寫成最便宜的商用影片 API。
2. 官方 ID、action 與欄位規則
發送 model: "happyhorse-1.1"。官方頁面將該值列為必填且為預設值。
action | 作用 | 額外必填項 | 說明 |
|---|---|---|---|
text-to-video | 由提示詞生成 | 必須提供 prompt | aspect_ratio 生效(16:9、9:16、1:1、4:3、3:4;預設 16:9)。相容別名:size。 |
image-to-video | 讓首幀動起來 | image_urls(只使用第一張圖) | prompt 可選,但建議用於控制運動和風格。圖生影片的寬高比由首幀尺寸決定。 |
reference-to-video | 由 1–9 張參考圖生成 | 必須提供 prompt 和 reference_images(1–9 張) | 不要依賴 action 自動檢測;請顯式設定為 reference-to-video。 |
video-edit | 編輯輸入影片 | 必須提供 prompt 和 url;reference_images 可選,最多 5 張 | audio_setting 為 auto 或 origin(預設 auto),且僅適用於該 action。 |
圖生影片首幀的相容別名:input_reference、images、image,或 image_with_roles[{ role: "first_frame" }]。官方頁面中的圖片要求:JPEG / JPG / PNG / BMP / WEBP,最大 10MB,至少 300px,寬高比介於 1:2.5 與 2.5:1。請使用公開 HTTP(S) URL;本地文件先透過 上傳圖片 API 或 上傳影片 API 上傳。不要在 image_urls 中傳 base64。
其他已文件化欄位:seed,以及 watermark(預設 true)。若需要乾淨輸出,請顯式把 watermark 設為 false——該預設值與若干 Vidu Q3 多模型示例相反。
該頁的分辨率字串是 720P 和 1080P。官方示例使用大寫 P。不要在未確認同一頁面也接受小寫形式的情況下,把它們悄悄改成 720p;示例並未使用小寫。
今天核對的官方欄位列表不包含 loop。不要文件化循環播放。該欄位列表中也沒有 fps,因此「720p 24fps 作為獨特賣點」是規劃稿說法,不是官方差異化能力。文件化的預設分辨率是 1080P。

圖 1:選擇已文件化的 action(text-to-video、image-to-video、reference-to-video 或 video-edit),提交 POST /v1/videos/generations,輪詢 GET /v1/videos/generations/{task_id},並在 completed 後讀取 result.data[0].url。
3. 生產實現:cURL 與 Python
官方示例使用 https://toapis.com。中國大陸應使用 https://toapis.cn。輪詢前先保存返回的任務 id。
步驟 1:文生影片的 cURL
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "text-to-video",
"prompt": "At night under an urban railway bridge, a graffiti teenager comes alive from a concrete wall and performs a high-energy English rap.",
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"seed": 42,
"watermark": true
}'
步驟 2:圖生影片與參考圖生影片的 cURL
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "image-to-video",
"prompt": "Animate the character naturally while preserving the original visual style.",
"image_urls": ["https://example.com/first-frame.png"],
"duration": 5,
"resolution": "1080P"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "reference-to-video",
"prompt": "The character from image 1 runs through the scene in image 2, then picks up the prop from image 3. Keep a 3D cartoon style.",
"reference_images": [
"https://example.com/image-01.jpg",
"https://example.com/image-02.png",
"https://example.com/image-03.jpeg"
],
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "16:9",
"watermark": false
}'
影片編輯使用 "action": "video-edit",必填輸入影片的 "url",可選最多 5 張 reference_images,以及 "audio_setting": "origin" 或 "auto"。
步驟 3:帶有界輪詢的 Python
import os
import time
import random
import requests
BASE = "https://toapis.com" # mainland China: https://toapis.cn
HEADERS = {
"Authorization": f"Bearer {os.environ['TOAPIS_API_KEY']}",
"Content-Type": "application/json",
}
def submit_happyhorse(payload: dict) -> str:
body = {"model": "happyhorse-1.1", **payload}
response = requests.post(
f"{BASE}/v1/videos/generations",
headers=HEADERS,
json=body,
timeout=30,
)
response.raise_for_status()
return response.json()["id"]
def poll_video_task(task_id: str, max_wait: int = 600, interval: int = 10) -> dict:
"""Poll until completed or failed, honoring Retry-After on 429."""
time.sleep(5)
start = time.time()
current = interval
while time.time() - start < max_wait:
response = requests.get(
f"{BASE}/v1/videos/generations/{task_id}",
headers=HEADERS,
timeout=30,
)
if response.status_code == 429:
retry_after = int(response.headers.get("Retry-After", current))
time.sleep(retry_after + random.uniform(0, 1))
current = min(current * 2, 60)
continue
response.raise_for_status()
data = response.json()
status = data.get("status")
if status == "completed":
return data
if status == "failed":
raise RuntimeError(data.get("error") or data)
time.sleep(current + random.uniform(0, 1))
raise TimeoutError(f"task {task_id} still running after {max_wait}s; query before resubmitting")
if __name__ == "__main__":
task_id = submit_happyhorse(
{
"action": "text-to-video",
"prompt": "At night under an urban railway bridge, a graffiti teenager comes alive from a concrete wall and performs a high-energy English rap.",
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"seed": 42,
"watermark": True,
}
)
result = poll_video_task(task_id)
print(result["result"]["data"][0]["url"])
print("expires_at", result.get("expires_at"))
官方 HappyHorse「查詢任務」片段使用 GET /v1/videos/generations/{task_id}。共享的狀態語義來自 查詢影片任務狀態:先等待 5 秒,間隔 10 秒,上限 600 秒,加入抖動,並在 429 時遵守 Retry-After。生產環境優先使用 任務 Webhooks,並把輪詢作為兜底。
4. 錯誤處理與狀態矩陣
HTTP 提交成功並不等於影片已經完成。務必讀取任務 status。
| HTTP 或任務狀態 | 常見類別 | 建議操作 |
|---|---|---|
400 | 未知型號(happyhorse-1-1)、video-edit 缺少 url、reference-to-video 缺少 reference_images、時長超出 3–15,或虛構了 loop 欄位 | 發送 happyhorse-1.1 以及所選 action 已文件化的欄位 |
400 | 首幀圖不滿足格式、大小或寬高比規則 | 使用 JPEG/JPG/PNG/BMP/WEBP,≤10MB,≥300px,寬高比 1:2.5–2.5:1 |
401 | 缺少或無效的 API 密鑰 | 確認 Authorization: Bearer <API_KEY>。官方 HappyHorse 頁面沒有文件化額外的 OAuth 範圍 |
429 | 速率或並發限制 | 遵守 Retry-After;帶抖動退避。不要假定存在已文件化的「100 路並行」上限 |
5xx 或客戶端超時 | 網關或上遊臨時問題 | 重新提交前先查詢已有任務 id |
status: queued 或 in_progress | 不是錯誤 | 繼續輪詢 GET /v1/videos/generations/{task_id} |
status: failed | 生成未成功 | 讀取 error.message。官方文件並未寫明失敗任務一定不計費 |
5. 價格與 FinOps
官方生成頁沒有發布 HappyHorse 1.1 的美元價表。2026-11-26 核對的現網 型號指南 給出的價格參考是 17.1428 credits/秒。
按當天 /pricing 頁面寫明的 1 credit ≈ $0.005($1 = 200 credits),該快照約為 $0.0857 / 秒——5 秒片段大約 85.7 credits(約 $0.43),10 秒片段大約 171.4 credits(約 $0.86)。未認證的 GET /api/v1/pricing 返回了 401;請透過 價格目錄 以及已完成任務上的 實際費用 欄位確認。
該費率並不低於同一天 viduq3 / viduq3-turbo 的 8.5714 credits/秒快照。$0.010/秒 或「性價比最高的商用影片 API」等規劃稿說法,不在今天核對的官方頁面上。當你需要其已文件化的 action 集合(尤其是 reference-to-video 和 video-edit)時再選擇 HappyHorse 1.1,而不是因為規劃稿稱它便宜。
請把所有數字當作有日期的快照。在預測高頻批量成本前,用 GET /v1/models?type=video 和帳戶目錄確認 ID 與實時報價。今天核對的官方頁面沒有文件化延遲或並發 SLA,因此請根據帳戶中觀察到的限額來設計輪詢器和佇列,而不是根據規劃稿中的「100 路並行 / 亞 12 秒」數字。
6. 常見問題
見 frontmatter 中的 FAQ。摘要:發送 happyhorse-1.1,不要發送 happyhorse-1-1;reference-to-video 和 video-edit 請顯式設定 action;使用大寫 P 的分辨率字串;不要文件化 loop;輪詢 GET /v1/videos/generations/{task_id} 並讀取 result.data[0].url;把 17.1428 credits/秒當作 2026-11-26 快照,而不是「目錄中最便宜」的斷言。
7. 行動清單
- 用
GET /v1/models?type=video確認你的密鑰能看到happyhorse-1.1— 不要發送happyhorse-1-1。 - 把
action設為已文件化的值。reference-to-video 發送 1–9 張reference_images;video-edit 發送url(以及可選的audio_setting)。 - 使用分辨率
720P或1080P(預設1080P),時長 3–15 秒。若不想使用預設的true,請顯式設定watermark。 - 本地媒體先上傳,只傳 HTTPS URL。不要發送 base64,也不要虛構
loop: true。 - 向
https://toapis.com(中國大陸為https://toapis.cn)的POST /v1/videos/generations提交。輪詢GET /v1/videos/generations/{task_id};僅在completed後讀取result.data[0].url。在expires_at之前下載(保留 30 天)。 - 只引用實時帳戶目錄中的價格。不要按
$0.010/秒或「最便宜 API」的說法預測批量成本。 - 下一步:Vidu Q3 開發者指南 了解已文件化的 subjects / 多參考圖一致性,或 Vidu Q3 Drama Mode 了解敘事參考片段。