HappyWan Video API Guide: Pre-Launch Access & Workflow
Availability Status (Updated November 30, 2026): HappyWan is coming soon to ToAPIs. Official model IDs, final specifications, and pay-as-you-go rates will be published on
/model-guide/happywanand/pricingupon release. Every code example in this HappyWan API guide uses ToAPIs' public production endpoint (POST /v1/videos/generationsandGET /v1/videos/generations/{task_id}) so you can test your application immediately against live models (wan3.0-video,wan2.6, andhappyhorse-1.1) and update a singleVIDEO_MODELvariable the day HappyWan goes live.
TL;DR: Client Decisions for HappyWan Pre-Integration
- Keep configuration flexible: Externalize your model name, resolution, and duration defaults so you can adopt the official HappyWan parameter sheet on launch day without code changes.
- Test on live models today: Build and verify your full asynchronous video submission, status polling, and storage download flow today using live models
wan3.0-videoorhappyhorse-1.1. - One-line launch switch: Keep Bearer authentication (
Authorization: Bearer <API_KEY>), endpoint paths, and status polling decoupled from the model name so adopting the HappyWan API is a pure configuration update. - Reliable client defaults: Validate request fields up front, poll every 3–5 seconds with a client-side timeout, retry transient
429/5xxresponses politely, and archive output videos into your own cloud storage within the 30-day retention window.
1. Why Application Teams Prepare Before HappyWan Launches
Product teams building AI video workflows rarely stumble over writing a single creative prompt. Instead, launch week usually slows down because of four everyday client-side integration issues that are easy to solve ahead of time:
- Fragmented provider SDKs slow down model adoption. Different providers use inconsistent field names for prompts, reference images, status checks, and errors. Writing custom wrappers means each new HappyWan or Wan release forces extra refactoring.
- Blocking web requests break on multi-second renders. Video generation is asynchronous. Apps that wait inside a web request or skip saving
task_idlose completed clips on page refreshes or server restarts. - Aggressive polling triggers HTTP 429 errors. Checking status every few hundred milliseconds does not speed up rendering—it only consumes rate-limit quota during busy launches.
- Missing validation and duration caps waste credits. Because video calls cost more than text calls, forwarding unchecked user inputs or allowing unbounded durations quickly drains an API balance.
Preparing your HappyWan API client against ToAPIs' public video endpoint eliminates all four issues before launch day. Because HappyWan sits within the Alibaba Wan and HappyHorse video ecosystem—where ToAPIs already supports wan3.0-video, wan2.6, happyhorse-1.0, and happyhorse-1.1 on the same public contract—you can verify your full client workflow today and keep HappyWan behind a clean configuration setting until official release.
2. Quick Start: Runnable Unified Video API Code (Ready for HappyWan Cutover)
ToAPIs provides a consistent Bearer-authenticated asynchronous video interface across supported video models:
- Global base URL:
https://toapis.com(Mainland China endpoint:https://toapis.cn) - Create video task:
POST /v1/videos/generations - Query task status:
GET /v1/videos/generations/{task_id}(standard task lookupGET /v1/tasks/{id}is also supported) - Output retention: Completed video URLs are retained for 30 days; download and store finished files in your own object storage right after completion.
2.1 Five-Second Verification via cURL
Export your ToAPIs API key and keep the target model externalized in VIDEO_MODEL. Today you can run this exact command with wan3.0-video or happyhorse-1.1. When the official HappyWan model ID becomes available on ToAPIs, update VIDEO_MODEL without modifying your HTTP client.
export TOAPIS_API_KEY="sk-your-toapis-api-key"
export TOAPIS_BASE_URL="${TOAPIS_BASE_URL:-https://toapis.com}"
# Live model today: "wan3.0-video" or "happyhorse-1.1"
# Switch to the official HappyWan model ID once live
export VIDEO_MODEL="${VIDEO_MODEL:-wan3.0-video}"
# Step 1: Submit an asynchronous video generation task
TASK_RESPONSE=$(curl -sS -X POST "${TOAPIS_BASE_URL}/v1/videos/generations" \
-H "Authorization: Bearer ${TOAPIS_API_KEY}" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"${VIDEO_MODEL}\",
\"prompt\": \"Cinematic wide panning shot along a rain-slicked coastal mountain highway at dusk, warm golden sunset reflections on ocean waves, smooth 35mm camera glide.\",
\"duration\": 5
}")
echo "Submit response: ${TASK_RESPONSE}"
# Step 2: Extract task_id and check task status
TASK_ID=$(printf '%s' "${TASK_RESPONSE}" | python3 -c "import sys, json; d = json.load(sys.stdin); print(d.get('id') or d.get('task_id') or d.get('data', {}).get('id', ''))")
echo "Polling task_id=${TASK_ID}"
curl -sS "${TOAPIS_BASE_URL}/v1/videos/generations/${TASK_ID}" \
-H "Authorization: Bearer ${TOAPIS_API_KEY}"
2.2 Clean Production Python Client (Validation, 3s Polling, Retry & Download)
In production applications, keep your client code modular and defensive. The standalone Python helper below works today with wan3.0-video or happyhorse-1.1, and transitions cleanly to the HappyWan API once launched:
- Validates prompt text and duration bounds before sending a billable request.
- Logs and persists the returned
task_idimmediately so your app can recover after restarts. - Polls
GET /v1/videos/generations/{task_id}every 3 seconds within a clear client timeout window. - Respects
Retry-Afterheaders and applies polite client-side exponential backoff on HTTP429or5xx. - Streams the finished MP4 directly to disk (or your S3/R2 bucket) so your app never depends on temporary links.
import os, pathlib, random, time
import requests
BASE = os.getenv("TOAPIS_BASE_URL", "https://toapis.com").rstrip("/")
HEADERS = {"Authorization": f"Bearer {os.environ['TOAPIS_API_KEY']}", "Content-Type": "application/json"}
MODEL = os.getenv("VIDEO_MODEL", "wan3.0-video") # Update to official HappyWan ID at launch
def retry_delay(attempt: int, retry_after: str | None = None) -> float:
if retry_after and retry_after.isdigit():
return min(60.0, float(retry_after))
return min(30.0, 1.5 * (2 ** attempt)) + random.uniform(0.0, 0.75)
def submit_video(prompt: str, model: str = MODEL, duration: int = 5, aspect_ratio: str = "16:9") -> str:
clean_prompt = prompt.strip()
if not clean_prompt or len(clean_prompt) > 2000:
raise ValueError("Prompt must be between 1 and 2000 characters.")
if not (2 <= duration <= 30):
raise ValueError("Keep client duration within an approved safety bound (e.g., 2-30s).")
payload = {"model": model, "prompt": clean_prompt, "duration": duration, "aspect_ratio": aspect_ratio}
for attempt in range(4):
r = requests.post(f"{BASE}/v1/videos/generations", headers=HEADERS, json=payload, timeout=30)
if r.status_code in (200, 201, 202):
d = r.json()
task_id = str(d.get("id") or d.get("task_id") or d["data"]["id"])
print(f"[saved] model={model} task_id={task_id}") # Persist task_id in your app DB here
return task_id
if r.status_code == 429 or r.status_code >= 500:
time.sleep(retry_delay(attempt, r.headers.get("Retry-After")))
continue
raise RuntimeError(f"Request rejected ({r.status_code}): {r.text[:200]}")
raise RuntimeError("Client submit retries exhausted.")
def poll_video(task_id: str, interval: float = 3.0, max_wait: float = 420.0) -> str:
deadline, errs = time.monotonic() + max_wait, 0
while time.monotonic() < deadline:
r = requests.get(f"{BASE}/v1/videos/generations/{task_id}", headers=HEADERS, timeout=30)
if r.status_code == 429 or r.status_code >= 500:
time.sleep(retry_delay(errs, r.headers.get("Retry-After"))); errs += 1; continue
r.raise_for_status(); errs = 0
data = r.json(); status = str(data.get("status", "")).lower()
if status in ("completed", "succeeded", "success"):
res = data.get("result") or data.get("data") or {}
items = res.get("data") if isinstance(res, dict) else None
return items[0]["url"] if isinstance(items, list) and items else (res.get("url") or data["url"])
if status in ("failed", "cancelled", "error"):
raise RuntimeError(f"Task {task_id} failed: {data}")
time.sleep(interval)
raise TimeoutError(f"Polling timed out after {max_wait}s for task {task_id}")
def download_video(video_url: str, output_path: str) -> pathlib.Path:
dest = pathlib.Path(output_path)
dest.parent.mkdir(parents=True, exist_ok=True)
with requests.get(video_url, stream=True, timeout=120) as resp:
resp.raise_for_status()
with dest.open("wb") as fh:
for chunk in resp.iter_content(chunk_size=1024 * 256):
if chunk:
fh.write(chunk)
return dest
if __name__ == "__main__":
tid = submit_video("Slow aerial dolly over misty emerald pine valleys at sunrise.", duration=5)
url = poll_video(tid)
saved = download_video(url, f"./outputs/{tid}.mp4")
print(f"Saved finished video to {saved}")
Notice how clean this structure is for HappyWan: your application already handles authentication, input checks, task_id persistence, 3-second polling, polite 429 backoff, and local/cloud download archiving before the HappyWan model ID even enters the catalog.
2.3 Organizing Async Polling Inside Your Web Application
Developers building user-facing web apps for the HappyWan API should keep video polling out of synchronous HTTP request threads:
- Submit fast, return a job ID: Submit
POST /v1/videos/generations, save{user_id, model, task_id, status: "queued"}in your database, and return your internal job ID to the browser. - Poll in a background worker: Use Celery, BullMQ, Sidekiq, or a cron job to check
GET /v1/videos/generations/{task_id}every 3–5 seconds untilcompletedorfailed. - Use a bounded timeout: Set a 5–7 minute active poll deadline and reconcile still-running tasks asynchronously rather than submitting duplicate billable requests.
3. HappyWan Ecosystem Context: Live Models Available on the Same API Format
Because HappyWan belongs to the Alibaba Wan and HappyHorse video ecosystem, developers can use live models on the exact same endpoint today while preparing for HappyWan's release.
| Model | ToAPIs Status (2026-11-30) | Documented API Model ID | Public Endpoint | How Developers Use It Today |
|---|---|---|---|---|
| HappyWan | Upcoming | Announced upon release | POST /v1/videos/generations (planned) | Follow release updates on /model-guide/happywan; keep VIDEO_MODEL configurable for launch day |
| Alibaba Wan 3.0 | Live | wan3.0-video / wan3.0-video-prime | POST /v1/videos/generations | All-in-One video generation (text, first/last frames, reference media, edit/extend); ideal for building your client today |
| Alibaba Wan 2.6 | Live | wan2.6 | POST /v1/videos/generations | Live text-to-video, image-to-video, and reference-video generation on the same endpoint |
| HappyHorse 1.1 | Live | happyhorse-1.1 (dot in API ID; /model-guide/happyhorse-1-1 in URL) | POST /v1/videos/generations | Action-based generation and editing (text-to-video, image-to-video, reference-to-video, video-edit, 3–15s, 720P/1080P) |
What to Expect When HappyWan Launches on ToAPIs
As soon as HappyWan becomes officially available, /model-guide/happywan and the API reference will publish four key updates together:
- Official API model ID ready to drop into your
VIDEO_MODELenvironment variable (including exact naming and punctuation). - Complete parameter reference documenting supported generation modes, duration bounds, aspect ratios, resolution options, and reference media fields.
- Live pay-as-you-go pricing displayed directly on
/pricingand in your account dashboard before you submit tasks. - Interactive playground and example outputs so your team can inspect real HappyWan video clips before migrating production traffic.
In the meantime, building your client against live wan3.0-video or happyhorse-1.1 lets your team ship working video features now and add HappyWan cleanly on launch day.
4. Production Client Best Practices: Parameters, Timeouts & Asset Storage
When integrating any asynchronous video generation endpoint—whether calling wan3.0-video, happyhorse-1.1, or the upcoming HappyWan API—your application code only needs to master four client-side responsibilities: clean parameter validation, disciplined status polling, polite HTTP error handling, and timely media archiving.

Figure 1: Client-side AI video workflow on ToAPIs — validate your prompt and keyframe inputs, submit and poll via the public /v1/videos/generations API, and archive the completed widescreen video clip to your own cloud storage (2026).
4.1 Parameter Validation Before Sending Requests
Most avoidable API errors happen before a task even enters rendering. Add a lightweight validation layer in your client:
- Prompt hygiene: Trim whitespace, enforce a reasonable maximum character limit, and avoid empty prompts on text-to-video calls.
- Explicit duration and aspect ratio: Always pass explicit, allow-listed values for
durationandaspect_ratio(orratiowhen documented for a specific model) rather than forwarding arbitrary user form values directly to the API. - Public HTTPS media URLs only: For image-to-video or reference-media workflows, supply publicly reachable HTTPS image/video URLs (or upload via ToAPIs' documented upload endpoints first). Avoid sending oversized raw base64 blobs inside JSON bodies.
- Isolate model-specific options: Keep model-specific fields in a small configuration adapter per model—for example,
happyhorse-1.1documents uppercase720P/1080Presolutions and explicitactionvalues, whereaswan3.0-videouses its own documented options. Isolating these fields makes adopting HappyWan's final parameter schema effortless on launch day.
4.2 Polling Cadence, Client Timeouts, and Task Persistence
- Save
task_idimmediately: Always write{job_id, model, task_id}to your database right afterPOST /v1/videos/generationsreturns. If your app container restarts mid-render, your worker can resume pollingGET /v1/videos/generations/{task_id}instead of paying for a second submission. - Poll every 3–5 seconds: Start polling at 3 seconds and optionally relax to 5 seconds after the first minute. Sub-second polling wastes request quota without making video rendering faster.
- Use a bounded client timeout: Give every render a sensible maximum wait window (e.g., 300–420 seconds). If your foreground loop hits its timeout while the task is still
in_progress, mark the job as pending reconciliation rather than immediately resubmitting the same prompt.
4.3 Handling Standard Public HTTP Status Codes in Your Client
| HTTP Status / State | Common Client Cause | Recommended Client-Side Action |
|---|---|---|
400 Bad Request | Unsupported parameter value, malformed media URL, or an unreleased model ID | Do not retry automatically; surface a clear validation message, log sanitized request params, and check available IDs via GET /v1/models?type=video |
401 Unauthorized | Missing, malformed, or revoked Authorization: Bearer <API_KEY> header | Stop retries immediately and check your API key in the ToAPIs dashboard |
402 Payment Required | Insufficient account credits or balance for the requested video task | Pause job submission, notify billing admins, and top up credits in /dashboard/billing |
429 Too Many Requests | Client request burst or polling too aggressively | Honor the Retry-After response header if present; otherwise apply exponential backoff with random jitter and reduce concurrent submissions |
500 / 502 / 503 / 504 | Temporary network or server hiccup | Retry GET /v1/videos/generations/{task_id} safely (reads are idempotent); only retry POST if no task_id was returned |
Task status: failed | Rejected prompt/media input or render failure | Inspect the returned error message, check your prompt and input asset URLs, and let the user adjust inputs before re-submitting |
4.4 Downloading and Persisting Generated Video Assets
Video URLs returned in result.data[0].url are retained on ToAPIs for 30 days. In production apps:
- Stream-download upon
completed: As soon as your polling worker seesstatus: "completed", download the MP4 stream directly to your own Cloudflare R2, AWS S3, or OSS bucket. - Verify file integrity: Check HTTP 200, non-zero
Content-Length, andvideo/mp4content type before marking the asset ready for end users. - Serve from your own CDN: Store your permanent object key in your database so historical user creations remain playable indefinitely, independent of temporary API output links.
5. Cost Estimation & Budget Control
Official HappyWan rates will be published on the ToAPIs Pricing page (/pricing) upon release. Until then, you can model monthly video spend around resolution, clip duration, and retry volume, using live models in the same ecosystem as a practical planning reference.
5.1 Ecosystem Billing Dimensions & Live Pricing Access
| Model | Billing Dimension | Current Pricing Status | Budget Planning Guidance |
|---|---|---|---|
| HappyWan | Announced upon release | Available on /pricing upon launch | Read live rates from /pricing dynamically once HappyWan launches |
Alibaba Wan 3.0 (wan3.0-video / wan3.0-video-prime) | Per-second (duration & resolution dependent) | Live on ToAPIs — check current account rates at /pricing | Start client integration with short 5-second clips before enabling longer durations |
HappyHorse 1.1 (happyhorse-1.1) | Per-second (action & resolution dependent) | Live on ToAPIs — check current account rates at /pricing | Useful live comparison baseline for action-oriented video generation and editing |
5.2 Measure True Unit Economics: Cost Per Accepted Clip
Headline per-second pricing only tells part of the story. In real creative applications, track Cost Per Accepted Clip (CPAC):
Where:
- $R_{\text{model}}$ is the live per-second (or per-request) account rate from ToAPIs
/pricing. - $D_{\text{billable}}$ is the billed output duration in seconds (always check resolution or audio multipliers once HappyWan publishes its rate table).
- $P_{\text{accept}} \in (0, 1]$ is the percentage of generated clips that pass your quality and brand checks without needing regeneration.
Why CPAC matters when HappyWan launches: Improving first-try acceptance rate $P_{\text{accept}}$ from 0.55 to 0.85 reduces wasted regenerations by 35% and lowers total compute spend per published video—even when nominal per-second rates differ.
5.3 Four Practical Client Budget Controls
- Enforce server-side duration and resolution caps. Keep default test renders at 5 seconds and gate longer durations behind explicit user tier permissions.
- Prevent duplicate submissions with idempotency keys. Hash
(user_id, model, normalized_prompt, input_media_urls, params)over a short window (such as 5 minutes) so accidental double-clicks never trigger two billable jobs. - Build a 10-prompt evaluation suite today. Test 10 representative prompts from your product on live
wan3.0-videoorhappyhorse-1.1now, so you can run the exact same prompt suite on HappyWan at launch and compare quality and CPAC objectively. - Read pricing and balance dynamically. Query your account balance and live catalog rates rather than maintaining brittle hand-edited spreadsheets.
6. Launch-Day Readiness Checklist for HappyWan API
Before updating your application's VIDEO_MODEL variable when HappyWan launches on ToAPIs:
- Confirm the official HappyWan model ID via
GET /v1/models?type=videoand/model-guide/happywan. - Check live rates on
/pricingand update your per-job budget cap. - Review HappyWan's parameter table (supported resolutions, duration limits, aspect ratios, and reference media fields) and update your client validator.
- Run one authenticated end-to-end test in staging checking
task_idpersistence, 3–5 second polling completion, and automatic download to your S3/R2 bucket.
7. Frequently Asked Questions
Is the HappyWan API available to call right now?
HappyWan is coming soon to ToAPIs. Once officially released, API calls and interactive generation on /model-guide/happywan will open automatically.
How can my team build a HappyWan-ready client today?
Integrate POST /v1/videos/generations and GET /v1/videos/generations/{task_id} using live wan3.0-video or happyhorse-1.1. Keeping the model name in an environment variable lets you switch to HappyWan with zero code rewrites once live.
When will HappyWan specifications and pricing be available?
Official model IDs, supported resolutions, duration limits, and pay-as-you-go rates will be published on /model-guide/happywan and /pricing as soon as HappyWan launches.
How long are generated videos stored on ToAPIs?
Completed video outputs are retained for 30 days. Download and store finished MP4 files in your own cloud storage immediately after completion.
Next Steps & Related Resources
- Follow HappyWan release updates: HappyWan Model Guide
- Test on live ecosystem models: Wan 3.0 Video Model Guide · HappyHorse 1.1 Model Guide
- Related developer tutorials: Alibaba Wan 3.0 Video API Quickstart · HappyHorse 1.1 Video API Guide · Wan 2.6 Image-to-Video Pipeline
- Check live account rates: ToAPIs Live Model Pricing