curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "text_to_video",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "first_frame_image_to_video",
"image": "https://example.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
},
)
response.raise_for_status()
print(response.json()["id"])
{
"id": "video_abc123def456",
"object": "generation.task",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
Grok Video
Grok Video 1.5 동영상 생성
텍스트, 첫 프레임 또는 참조 이미지로 동영상 생성
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "text_to_video",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "first_frame_image_to_video",
"image": "https://example.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
},
)
response.raise_for_status()
print(response.json()["id"])
{
"id": "video_abc123def456",
"object": "generation.task",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
중국 본토에서는 예시의
https://toapis.com 대신 https://toapis.cn 을 사용하세요.grok-video-1.5 에서 아래 3 가지 입력 모드를 요청할 수 있습니다. 호환 채널에서 활성화된 모드만 사용할 수 있습니다. 견적 조회가 성공해도 생성 가능한 채널이 있다는 뜻은 아닙니다.
공개 접근이 가능한
http:// 또는 https:// 이미지 URL 을 사용하세요. 로컬 파일은 먼저 이미지 업로드 API로 업로드하고 base64 를 직접 보내지 마세요. 업로드된 URL 을 JSON 으로 보내면 지원 채널에서 공통으로 사용할 수 있습니다. 일부 채널은 multipart 바이너리 파일 업로드를 받지 않습니다.생성 모드
| 모드 | 입력 |
|---|---|
text_to_video | 프롬프트만 전송, 이미지 없음 |
first_frame_image_to_video | 첫 프레임 정확히 1 장 |
reference_images_to_video | 참조 이미지 1-7 장, 단일 참조도 포함 |
video_generation_mode 를 명시하세요. 생략하면 기존 단일 이미지 동작이 유지되며, reference_images 가 1 장이어도 참조 모드로 자동 전환되지 않습니다. 텍스트 모드에는 이미지를 포함할 수 없습니다.
인증
string
필수
API 키를 Bearer Token 으로 전달하세요.
Authorization: Bearer YOUR_API_KEY
요청 파라미터
string
기본값:"grok-video-1.5"
필수
공개 모델 이름
grok-video-1.5 를 사용하세요. 공급업체 모델 이름으로 바꾸지 마세요.string
장면과 움직임을 설명합니다. 텍스트 및 참조 모드에서는 필수입니다. 일부 기존 단일 프레임 요청은 생략할 수 있지만, 다른 첫 프레임 요청에서는 필요할 수 있습니다. 새 연동에는 비어 있지 않은 프롬프트를 넣으세요.
string
기존 클라이언트는 생략할 수 있습니다. 실제 입력에 맞는 값을 선택하세요: 텍스트만 사용하면
text_to_video, 첫 프레임이 1 장이면 first_frame_image_to_video, 참조 이미지가 1-7 장이면 reference_images_to_video. 모드는 image, input_reference 또는 reference_images 의 실제 입력과 일치해야 하며, 일치하지 않으면 거부됩니다. 참조 이미지가 1 장일 때는 기존 첫 프레임 입력과 구분되도록 참조 모드를 명시해야 합니다.string
첫 프레임 URL. 첫 프레임 모드에서 필수이며
input_reference 로 대체할 수 있습니다. 텍스트 및 순수 참조 모드에서는 생략합니다. 첫 프레임의 실제 처리는 채널에 따라 다릅니다.string
첫 프레임 URL 의 문자열 별칭입니다.
image 와 둘 중 하나를 사용하고 서로 다른 값을 동시에 보내지 마세요. 새 요청에서 이 별칭을 사용할 때는 모드도 명시하세요.array
1-7 장의 참조 URL. 문자열 배열 또는
{"url":"https://example.com/reference.jpg"} 객체 배열을 지원합니다. 참조 모드에서 필수입니다. 기존 image_urls 와 images 별칭도 지원하지만 내용이 다른 여러 목록을 동시에 보내지 마세요.integer
정수 초 단위로 명시하세요. 1-15 초를 지원합니다.
string
참조 모드는
480p 또는 720p 를 사용합니다. 텍스트 및 첫 프레임 모드는 채널에서 지원할 때 1080p 를 사용할 수 있습니다. 이 페이지의 예시는 720p 를 명시합니다.string
화면 비율, 예:
16:9. 일반적인 값은 1:1, 16:9, 9:16, 3:2, 2:3 이며 지원 범위는 채널에 따라 다릅니다.호환성 제한
일부 채널은 단일 첫 프레임과 단일 참조 이미지를 같은 방식으로 처리합니다. 모드 이름만으로 엄격한 첫 프레임 제어를 보장하지 않습니다. 모드를 활성화해도 프로토콜 제한은 유지됩니다. 지원하지 않는 입력은 제출 전에 거부될 수 있으며, 호환되는 활성 채널이 없으면 생성할 수 없습니다.요금
동영상 요금은 현재 계정 및 SKU 설정에 따릅니다. 현재 요금과 인증된 파라미터별 견적을 확인하세요. 이 페이지는 고정 초당 가격을 보장하지 않습니다.동영상 작업 생성
예시는 모드, 길이, 해상도를 명시합니다. 이미지 URL 을 실제 접근 가능한 주소로 바꾸세요.curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "text_to_video",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "first_frame_image_to_video",
"image": "https://example.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
},
)
response.raise_for_status()
print(response.json()["id"])
참조 이미지 예시
{
"model": "grok-video-1.5",
"prompt": "A cinematic product shot with a slow camera push-in",
"video_generation_mode": "reference_images_to_video",
"reference_images": [
"https://example.com/reference-a.jpg",
"https://example.com/reference-b.jpg"
],
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9"
}
응답
string
폴링에 사용할 작업 ID.
string
객체 유형:
generation.task.string
요청한 공개 모델 이름.
string
작업 상태:
queued, in_progress, completed, failed.{
"id": "video_abc123def456",
"object": "generation.task",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
작업 상태 조회
반환된id 로 동영상 작업 상태 API를 조회하세요.