Happyhorse 1.1
happyhorse-1.1/image-to-video
가격
happyhorse-1.1/image-to-video per second
| 사양 | 단가 |
|---|---|
| 720P | $0.160 |
| 1080P | $0.210 |
소개 준비 중
이 모델의 상세 가이드를 준비 중입니다. 아래의 가격, 파라미터, API 문서는 이미 확인하실 수 있습니다.
생성 작업 제출
https://api.hiapi.ai/v1/tasks 헤더
Authorizationstring필수계정 API 키. 모든 요청에 필수입니다. 예: Bearer YOUR_HIAPI_API_KEY. API 키 받기
Content-Typestring선택요청 본문은 항상 JSON으로 파싱됩니다. 전송 시 application/json(charset 포함 가능)만 허용되며, 다른 값은 415를 반환합니다. 예: application/json.
Idempotency-Keystring선택멱등 키. 최대 255바이트. 같은 계정에서 같은 키의 재시도는 태스크를 한 번만 생성하며, 재전송 시 최초의 taskId를 반환합니다.
네트워크 타임아웃이나 클라이언트 자동 재시도 시 같은 키로는 태스크를 한 번만 생성하고 이중 과금되지 않습니다(범위 = API 키의 계정). 업무 고유 식별자(예: "order-42")를 키로 사용할 것을 권장합니다. 같은 키 재전송 시 최초 taskId를 반환하며, 키는 첫 제출 후 24시간 뒤 만료됩니다. 자세한 시나리오 표는 통합 비동기 API 소개 페이지를 참고하세요.
본문
modelstring필수현재 고정 값: happyhorse-1.1/image-to-video
routestring선택현재 고정 값: default
inputobject필수
happyhorse-1.1/image-to-video 및 루트 default의 비즈니스 파라미터 객체. 아래 파라미터 표를 참조하세요.
promptstring선택maxLength 5000Optional text prompt to guide the generated motion and style.
durationinteger선택기본값: 5min 3max 15Clip length in seconds (3-15). Cost scales with duration.
image_urlsarray필수minItems 1maxItems 1First-frame image URL (exactly 1). JPEG/PNG/WEBP, shortest side >= 300px, <= 20MB.
Array [ string ]
resolutionstring선택기본값: "1080p"Output video resolution. Higher resolution costs more.
720p1080pcallbackobject선택
종료 상태 알림 설정. 생략하면 콜백이 전송되지 않으며 호출 측에서 폴링합니다.
생성 시 callback.url을 지정하면 태스크 종료 시 HiAPI가 서비스로 POST하여 폴링이 필요 없습니다. 콜백 본문은 태스크 상세와 동일한 구조입니다. 서명 검증·재시도·멱등에 대한 자세한 내용은 통합 비동기 API 소개 페이지의 콜백 설명을 참고하세요.
urlstring필수callback 사용 시 필수. 태스크 종료 후 이 URL로 POST됩니다. 유효한 http(s) URL이어야 합니다.
whenstring선택기본값: "final"현재는 final만 지원(success / fail 모두 알림).
finalstoragestring선택기본값: "temp"산출물 저장 등급: temp(기본·약 7일) 또는 persistent(장기 보관·용량 과금). 잔액 부족이나 저장 한도 초과 시 자동으로 temp로 강등됩니다. 실제 적용된 등급은 태스크 상세 응답에서 확인할 수 있습니다.
temppersistent요청 예시
# 비동기 태스크 제출. 성공 시 즉시 taskId 반환(생성 완료 대기 없음)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.1/image-to-video",
"input": {
"duration": 5,
"image_urls": "…",
"resolution": "1080p"
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "happyhorse-1.1/image-to-video",
input: {
"duration": 5,
"image_urls": "…",
"resolution": "1080p"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "happyhorse-1.1/image-to-video",
"input": {
"duration": 5,
"image_urls": "…",
"resolution": "1080p"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} 작업 상세 조회
https://api.hiapi.ai/v1/tasks/:id 응답 필드
taskIdstring필수태스크 ID. 접두사는 항상 tk-hiapi-.
modelstring필수확인된 전체 모델명. route 파라미터로 제출한 태스크는 base@route(예: gpt-image-2/text-to-image@ext)를 반환하며, 그 외에는 제출 시의 모델명과 동일합니다.
routestring선택route 파라미터를 명시해 제출한 태스크에만 나타나며, 제출한 값을 그대로 반환합니다.
statusstring필수태스크 상태.
queued 대기 중, 아직 시작되지 않음.
handling 처리 중.
archiving 처리 완료, 산출물 준비 중.
success 종료: 완료. 산출물 사용 가능(output 반환).
fail 종료: 실패(error 반환).
제출 후 status로 판단합니다: success와 fail이 종료 상태이며 나머지는 비종료입니다. 1~3초 간격으로 종료까지 폴링하세요. 성공 시 output[].url에서 산출물을 다운로드하고 expireAt 전에 옮기세요. 장기 보관이 필요하면 생성 시 storage: "persistent"를 사용하세요.
creatednumber필수태스크 생성 시각(Unix 초).
completednumber필수종료 상태가 된 Unix 초. 비종료 상태에서는 0.
outputarray선택
status == success일 때만 나타납니다. 산출물 목록 — 항상 배열이며, 하나의 태스크에서 여러 type을 동시에 반환할 수 있습니다(예: video + first_frame).
Array [ object ]
배열 항목
urlstring필수산출물 URL. 바로 다운로드할 수 있습니다.
typestring필수현재 가능한 값: video, image, audio, first_frame, last_frame, thumbnail. 이후 확장될 수 있습니다.
expireAtnumber필수산출물 접근 가능 기한(Unix 초). 만료 전에 다운로드하거나 이전하세요.
errorobject선택
status == fail일 때만 나타납니다.
codestring필수비즈니스 오류 코드.
messagestring필수오류 설명.
응답 예시
성공
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} 처리 중(비종료)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} 실패
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
}