Grok Imagine Video API
xAI의 Grok Imagine 비디오 생성 모델에 대한 완전한 API 레퍼런스입니다.
모델 변형
이 API는 두 가지 모델 변형을 지원합니다:
빠른 비교
Grok Imagine Text to Video
엔드포인트 {#}
POST /api/v1/video/task
요청 파라미터
필수
선택 사항
요청 예시
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'grok-imagine-text-to-video',
prompt: 'A robot walking through a futuristic city',
duration: 6,
resolution: '720p',
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Grok Imagine Image to Video
요청 파라미터
필수
선택 사항
요청 예시
{
model_name: 'grok-imagine-image-to-video',
images: ['https://example.com/reference.jpg'],
prompt: 'Camera slowly zooms in on the subject',
duration: 6,
resolution: '720p'
}
응답 형식
초기 응답
두 모델 모두 폴링을 위한 task_id를 반환합니다:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
폴링 응답
GET /api/v1/video/{taskId}를 폴링하여 상태를 확인합니다:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
상태 값
submitted: 작업이 제출되었으며 처리 대기 중
processing: 비디오 생성 진행 중
succeed: 비디오 생성 완료
failed: 비디오 생성 실패
처리 시간
일반적인 처리 시간: 2-5분.
모범 사례
- 창의적인 프롬프트: Grok Imagine Video는 상상력이 풍부하고 상세한 장면 설명에서 뛰어난 성능을 발휘합니다
- 동작 설명: 프롬프트에 카메라 움직임과 피사체 동작을 포함하세요
- 이미지 품질: 이미지-비디오 변환 시 고품질 입력 이미지를 사용하세요