The API: models, pricing, and cost math
Calling HappyHorse-1.0 programmatically — the three model endpoints, official per-second pricing with real per-clip math, and how third-party platforms compare.
更新于 2026-07-17
Everything so far works in a web UI. This lesson is for shipping HappyHorse-1.0 inside a product or pipeline: the endpoints, the request shape, and — most importantly, because per-second video pricing surprises people — the cost math.
The three models
The official API (Alibaba Cloud Bailian) exposes three model IDs:
| Model ID | Mode | Input |
|---|---|---|
happyhorse-1.0-t2v | Text-to-video | prompt |
happyhorse-1.0-i2v | Image-to-video | prompt + first-frame image |
happyhorse-1.0-r2v | Reference-to-video | prompt + reference image(s) |
All three return video with generated audio, 3–15 s, up to 1080p, in the five standard aspect ratios.
Official pricing (Bailian)
Billing is per second of generated video, by resolution tier:
| Resolution | List price | Promotional price* |
|---|---|---|
| 720p | ¥0.9 / s (~$0.13) | ¥0.44 / s (~$0.06) |
| 1080p | ¥1.6 / s (~$0.22) | ¥0.78 / s (~$0.11) |
*Launch-period discount; USD conversions approximate. Verify current rates in the Bailian console before budgeting — promo pricing has been running since launch but is not guaranteed.
Per-clip math (10-second clip):
- Draft at 720p: 10 × ¥0.9 = ¥9 (~$1.25) — or ~¥4.4 at promo
- Final at 1080p: 10 × ¥1.6 = ¥16 (~$2.20) — or ~¥7.8 at promo
The draft-cheap-finish-expensive habit from Lesson 2 is a real budget lever here: five 720p/5s iterations plus one 1080p/10s final ≈ ¥38 list, versus ¥96 if you'd iterated at final quality. At promo rates, roughly half that.
Request shape
Video generation is asynchronous everywhere: you submit a task, then poll (or receive a webhook). The exact schema varies by platform — this is the Bailian pattern in outline:
POST /api/v1/services/aigc/video-generation/generation
{
"model": "happyhorse-1.0-t2v",
"input": { "prompt": "A chestnut horse gallops..." },
"parameters": { "resolution": "1080p", "duration": 10, "ratio": "16:9" }
}
→ { "task_id": "..." } // then poll the task endpoint for the video URL
Production notes that apply on every host:
- Store the video immediately. Result URLs are temporary (typically 24 h) — download to your own bucket on completion.
- Idempotency + retries. Tasks occasionally fail on content-filter or capacity grounds; build one automatic retry, then surface the error.
- Content filters are strict on faces of real public figures and violent content; design your product's prompts accordingly.
Third-party platforms
- fal.ai — official API partner. Simpler Western billing (USD, card), websocket/queue APIs, good latency. Pricing is competitive with list Bailian rates; check per-model pages.
- kie.ai — aggregator positioning itself under official pricing; useful at volume, with the usual aggregator trade-off (an extra dependency between you and the model).
- Aggregator sites with credit systems (e.g. happyhorseai.top) — practical when you want humans, not code, spending the budget: buy credits, let the team generate.
Decision rule: Bailian for production Chinese-cloud deployments, fal.ai for Western product integration, kie.ai to shave costs at volume, aggregator UI for non-developer teams.
Estimating a real workload
A short-form content pipeline producing 30 vertical clips/day, each 8 s at 1080p, one retry average (×2 generations):
30 clips × 2 × 8 s × ¥1.6 = ¥768/day (~$107) list — or
¥374/day ($52) at promo rates.
At that spend, a 10% retry-rate improvement from better prompting (Lessons 3–6) pays for itself immediately — which is the actual reason this course exists.
Final lesson: the model everyone compares HappyHorse against, and how to choose between them.