시작하기 · 약 5분 소요 · 검증일 2026-12-02
API 빠른 시작: 3분 만에 첫 영상 렌더링하기
Bearer hwk_live_* 키로 인증한 뒤 POST https://happywanvideo.ai/api/jobs로 실제 Wan 3.0 또는 HappyHorse 1.1 영상 작업을 요청하고, GET /api/jobs/{id}를 폴링해 첫날부터 바로 HappyWan 연동을 완료하세요.
1. 통합 단일 엔드포인트 아키텍처
HappyWan Video는 Alibaba의 라이브 영상 생성 모델(wan-3.0, wan-3.0-pro, happyhorse-1.1)과 출시 예정 플래그십 모델(happywan-1.0, 2026년 12월 출시 예정)을 하나의 표준화된 REST 인터페이스로 제공합니다. 모델 세대마다 달라지는 필드명(duration 대 duration_seconds, ratio 대 aspect_ratio, audio 대 암시적 오디오)을 따로 관리할 필요 없이, 클라이언트에서는 일관된 단일 JSON 구조만 POST https://happywanvideo.ai/api/jobs로 전송하면 됩니다.
신규 계정마다 50 무료 체험 크레딧이 제공되며, curl, TypeScript 또는 Python으로 네이티브 오디오가 포함된 실제 10초 480p Wan 3.0 렌더링(초당 5크레딧)이나 5초 720p 렌더링(초당 10크레딧)을 즉시 실행해 볼 수 있습니다.
happywan-1.0 출시 전 보호 안내
2026-12-02 기준 engine: "happywan-1.0"을 요청하면 Alibaba의 정식 출시(GA) 전까지 크레딧이 차감되지 않는 비과금 출시 전 안내 메시지가 반환됩니다. 현재는 wan-3.0, wan-3.0-pro 또는 happyhorse-1.1로 연동 및 테스트를 진행하고, 정식 출시일에 문자열 하나만 전환하세요.
2. Bearer API 키(`hwk_live_*`) 생성
HappyWan Studio에 로그인한 뒤 /studio/api-keys로 이동해 권한 범위가 지정된 API 키를 발급받으세요. 키는 hwk_live_로 시작하며 생성 시 단 한 번만 표시되고, 서버 측에는 SHA-256 다이제스트 형태로만 저장됩니다. 모든 요청의 표준 HTTP Authorization 헤더에 키를 담아 전달하세요.
export HAPPYWAN_API_KEY="hwk_live_your_generated_token_here"
3. 라이브 영상 작업 요청 및 완료 상태 폴링
영상 생성은 비동기로 처리됩니다. POST /api/jobs 호출이 성공하면 초당 정확한 크레딧이 원자적으로 예약되고 렌더링 작업이 대기열에 등록되며, id, status(queued 또는 processing), creditsCharged가 포함된 job 객체가 반환됩니다. status가 completed(outputUrl 확인) 또는 failed / refunded로 전환될 때까지 3~5초마다 GET /api/jobs/{id}를 폴링하세요.
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.");
}
}
}