Getting Started · 5 min read · Verified 2026-12-02
API Quickstart: First Video Render in 3 Minutes
Authenticate with a Bearer `hwk_live_*` key, submit a live Wan 3.0 or HappyHorse 1.1 video job to `POST https://happywanvideo.ai/api/jobs`, poll `GET /api/jobs/{id}`, and make your integration Day-1 ready for HappyWan.
1. Unified Single-Endpoint Architecture
HappyWan Video exposes one normalized REST surface across Alibaba's live video models (`wan-3.0`, `wan-3.0-pro`, `happyhorse-1.1`) and the pre-launch flagship (`happywan-1.0`, expected December 2026). Instead of maintaining divergent field names (`duration` vs. `duration_seconds`, `ratio` vs. `aspect_ratio`, `audio` vs. implicit audio) across model generations, your client sends one consistent JSON structure to `POST https://happywanvideo.ai/api/jobs`.
Fund your workspace with any non-expiring Pay-As-You-Go pack starting at $19 (1,000 credits, all-in USD) or a monthly/annual subscription—enough to run up to 200 seconds of 480p Wan 3.0 drafting (5 credits/sec) or 100 seconds of 720p renders (10 credits/sec) with native audio immediately via curl, TypeScript, or Python.
Pre-Launch Protection on `happywan-1.0`
As of 2026-12-02, submitting `engine: "happywan-1.0"` returns a clean non-billable pre-launch notice (zero credits deducted) until Alibaba opens general availability. Build and test against `wan-3.0`, `wan-3.0-pro`, or `happyhorse-1.1` today, then flip a single string on launch day.
2. Create a Bearer API Key (`hwk_live_*`)
Sign in to HappyWan Studio and navigate to `/studio/api-keys` to generate a scoped API key. Keys begin with `hwk_live_`, are displayed once upon creation, and are stored server-side solely as SHA-256 digests. Pass your key in the standard HTTP `Authorization` header on every request.
export HAPPYWAN_API_KEY="hwk_live_your_generated_token_here"
3. Submit a Live Video Job and Poll to Completion
Video generation is asynchronous. A successful `POST /api/jobs` call reserves exact per-second credits atomically, enqueues the render, and returns a job object containing `id`, `status` (`queued` or `processing`), and `creditsCharged`. Poll `GET /api/jobs/{id}` every 3–5 seconds until `status` transitions to `completed` (inspect `outputUrl`) or `failed` / `refunded`.
curl -X POST https://happywanvideo.ai/api/jobs \
-H "Authorization: Bearer $HAPPYWAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"engine": "wan-3.0",
"mode": "text-to-video",
"prompt": "Slow 35mm tracking shot through a sunlit Tokyo record shop as vinyl sleeves flutter near an open window. Warm analog hum, soft wooden floor footsteps.",
"duration": 5,
"resolution": "480p",
"aspectRatio": "16:9",
"generateAudio": true,
"enablePromptExpansion": false
}'curl -X GET https://happywanvideo.ai/api/jobs/hwj_0123456789abcdef \ -H "Authorization: Bearer $HAPPYWAN_API_KEY"
const BASE = "https://happywanvideo.ai";
async function renderClip() {
const headers = {
Authorization: `Bearer ${process.env.HAPPYWAN_API_KEY}`,
"Content-Type": "application/json",
};
const createRes = await fetch(`${BASE}/api/jobs`, {
method: "POST",
headers,
body: JSON.stringify({
engine: "wan-3.0",
mode: "text-to-video",
prompt: "Macro slow-motion pour of iced matcha into fluted glass on travertine stone. Crisp ice clinks, quiet morning kitchen.",
duration: 5,
resolution: "720p",
aspectRatio: "9:16",
generateAudio: true,
}),
});
const created = await createRes.json();
if (!createRes.ok) throw new Error(created.error || "Job creation failed");
const jobId = created.job.id as string;
while (true) {
await new Promise((r) => setTimeout(r, 4000));
const pollRes = await fetch(`${BASE}/api/jobs/${jobId}`, { headers });
const { job } = await pollRes.json();
if (job.status === "completed") return job.outputUrl as string;
if (job.status === "failed" || job.status === "refunded") {
throw new Error(job.errorMessage || "Render failed; credits refunded.");
}
}
}