xAI 비디오 생성
CometAPI POST /grok/v1/videos/generations를 사용해 입력 이미지와 프롬프트로 Grok image-to-video 작업을 생성한 다음, request_id로 결과를 폴링합니다.
request_id가 즉시 반환되므로 비동기 워크플로의 첫 단계로 다루어야 합니다.
작은 요청으로 시작하기
model: grok-imagine-video-1.5사용image.url을 공개된 JPEG, PNG 또는 WebP URL로 설정- 첫 요청에서는
duration을1,resolution을720p로 유지 - 애니메이션 방향이 분명하도록
prompt를 구체적으로 작성 - base64를 보낼 경우 문서와 OpenAPI 예시 형식은
data:image/png;base64,<BASE64_IMAGE_DATA>로 유지
기간과 해상도
작업 흐름
작업 생성
request_id를 저장합니다.완료될 때까지 폴링
done이 될 때까지 xAI 비디오 결과 가져오기를 호출합니다.출력 저장
video.url을 자체 스토리지에 복사합니다.인증
Bearer token authentication. Use your CometAPI key.
본문
Prompt describing how the source image should animate. CometAPI requires this field for this route.
"Animate the still image with a slow camera move and natural motion."
Output aspect ratio. Combine with resolution to choose the target frame; for example 480p with 1:1 targets 480x480, 720p with 16:9 targets 1280x720, and 720p with 9:16 targets 720x1280. This endpoint does not expose an exact size field.
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 Output duration in seconds. Use an integer from 1 through 15. If omitted, CometAPI treats the request as an 8-second generation for billing and default handling.
Source image for image-to-video. Use a public JPEG, PNG, or WebP URL, or a data URI such as data:image/png;base64,<BASE64_IMAGE_DATA>.
xAI video model id. The default example uses Grok Imagine 1.5 for image-to-video.
"grok-imagine-video-1.5"
Output resolution. Use 720p for a small image-to-video test, or 1080p when you need a higher resolution tier.
480p, 720p, 1080p Deprecated size field. Prefer aspect_ratio and resolution.
Optional end-user identifier.
응답
Request accepted.
Deferred request id used for polling.