HeyGen Video 텍스트→비디오
텍스트에서 사운드가 포함된 5~15초 영상을 생성하고, 선택적으로 참조 이미지, 영상, 오디오를 사용하세요.
개요
지원되는 모델로 텍스트를 비디오로 변환하는 엔드포인트를 사용하세요. 반환된 Task ID로 상태를 조회하거나, 아래에 문서화된 전달을 위해 callback_url을 제공하세요.
빠른 시작
- API 키를 만들고 RUNAPI_API_KEY로 설정합니다.
- 지원되는 모델을 선택하고 해당 모델의 스키마와 일치하는 본문으로 POST 요청을 전송합니다.
- 반환된 작업 ID를 저장한 후, 터미널 상태가 될 때까지 폴링하거나 아래에 문서화된 콜백을 처리하세요.
엔드포인트
- Base URL
https://runapi.ai- API 버전
v1- 인증
Authorization: Bearer YOUR_API_TOKEN
지원 모델
현재 가격, 속도 제한 및 상업적 이용 세부 정보는 모델 페이지를 여십시오.
요청 스키마
필드와 허용 값은 선택된 모델에 따라 다릅니다. 제공된 경우 callback_url은 아래에 문서화된 Task 전달을 수신합니다.
heygen-video-1필드 10개
aspect_ratiostring생성 영상의 화면 비율입니다. adaptive는 첫 번째 참조 이미지 또는 영상을 따르며, 480p 또는 768p의 참조 미디어 요청에서만 사용할 수 있습니다.
허용 값:adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16
callback_urlstring비동기 알림을 위한 웹훅 URL.
duration_secondsinteger생성된 비디오 길이(초).
허용 값:5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
기본값: 5
modelstring모델 슬러그.
output_resolutionstring생성 영상 해상도입니다. 1080p와 2k는 16:9와 9:16만 지원합니다.
허용 값:480p, 768p, 1080p, 2k
기본값: 768p
promptstring장면, 대사, 사운드를 설명하는 영상 생성 프롬프트입니다.
범위:1 - 16000
reference_audio_urlsarray공개 HTTPS 참조 오디오 URL(각 최대 32 MB)입니다. 참조 이미지 또는 영상이 필요합니다.
항목 제한:3
reference_image_urlsarray공개 HTTPS 참조 이미지 URL(각 최대 16 MB)입니다. 이미지, 영상, 오디오를 합쳐 최대 12개의 참조 파일을 사용할 수 있습니다.
항목 제한:9
reference_video_urlsarray화면 비율이 1:4에서 4:1 사이인 공개 HTTPS 참조 영상 URL(각 최대 32 MB)입니다. 각 영상의 처음 5초만 사용됩니다.
항목 제한:3
seedinteger재현 가능한 생성을 위한 랜덤 시드입니다.
범위:0 - 4294967295
조건부 규칙
이 요구 사항은 나열된 모든 조건이 일치할 때 적용됩니다.
-
다음의 경우
reference_audio_urls present- 필수
- 허용되지 않음
-
다음의 경우
reference_image_urls absent,reference_video_urls absent- 필수
- 허용되지 않음
-
다음의 경우
output_resolution = 1080p- 필수
- 허용되지 않음
-
다음의 경우
output_resolution = 2k- 필수
- 허용되지 않음
수락 만들기
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
},
"task_replayed": {
"type": "boolean"
}
},
"required": [
"id",
"status"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"id": "tsk_reference_demo",
"status": "processing"
}
폴링 처리 중
GET /api/v1/heygen_video/text_to_video/:id
응답 스키마
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
}
},
"required": [
"id",
"status"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"id": "tsk_reference_demo",
"status": "processing"
}
폴링 완료
GET /api/v1/heygen_video/text_to_video/:id
응답 스키마
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"completed"
],
"type": "string"
},
"usage": {
"properties": {
"cost": {
"type": "number"
}
},
"required": [
"cost"
],
"type": "object",
"unevaluatedProperties": false
},
"videos": {
"items": {
"properties": {
"url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"required": [
"url"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
}
},
"required": [
"id",
"status",
"videos",
"usage"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"id": "tsk_reference_demo",
"status": "completed",
"usage": {
"cost": 0.05
},
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
폴링 실패
GET /api/v1/heygen_video/text_to_video/:id
응답 스키마
{
"properties": {
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
고객 콜백: 완료됨
POST callback_url
응답 스키마
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"completed"
],
"type": "string"
},
"usage": {
"properties": {
"cost": {
"type": "number"
}
},
"required": [
"cost"
],
"type": "object",
"unevaluatedProperties": false
},
"videos": {
"items": {
"properties": {
"url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"required": [
"url"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
}
},
"required": [
"id",
"status",
"videos",
"usage"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"id": "tsk_reference_demo",
"status": "completed",
"usage": {
"cost": 0.05
},
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
고객 콜백: 실패함
POST callback_url
응답 스키마
{
"properties": {
"error": {
"oneOf": [
{
"type": "string"
},
{
"properties": {
"code": {
"type": "string"
},
"limit_cents": {
"type": "integer"
},
"message": {
"type": "string"
},
"reset_at": {
"format": "date-time",
"type": [
"string",
"null"
]
},
"used_cents": {
"type": "integer"
},
"window": {
"enum": [
"1h",
"1d",
"7d",
"daily",
"weekly",
"monthly",
"lifetime"
],
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"unevaluatedProperties": false
}
]
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Authentication required"
}
오류
GET /api/v1/heygen_video/text_to_video/:id
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Authentication required"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"oneOf": [
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 유효성 검사 요약입니다.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "공개 요청 필드를 키로 하는 유효성 검사 메시지로, 각 필드에 대해 사람이 읽을 수 있는 문자열 배열이 포함됩니다.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
응답 예시
{
"error": "model must be one of: heygen-video-1"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Insufficient balance"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "API key credit limit exceeded"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "The request uses features that are not supported for the selected model"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Rate limit reached. Please retry later."
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Service under maintenance, please try again later"
}
오류
POST /api/v1/heygen_video/text_to_video
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "The request timed out"
}
오류
GET /api/v1/heygen_video/text_to_video/:id
응답 스키마
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
{
"error": "Task with id 'tsk_reference_demo' not found"
}
생성된 코드 샘플
cURL을 직접 사용하거나 해당 언어의 SDK를 설치하세요. 각 샘플은 이 레퍼런스에 표시된 유효성 검사된 요청을 제출합니다.
설치
pip install runapi-heygen-video
import os
from runapi.heygen_video import HeyGenVideoClient
client = HeyGenVideoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_video.create(
model="heygen-video-1",
prompt="A plant supervisor in a plain grey coat stands beside a conveyor line and speaks to camera.",
aspect_ratio="16:9",
output_resolution="768p"
)