메인 콘텐츠로 건너뛰기
POST
/
grok
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.cometapi.com/grok/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A candle flickers on a wooden table."
}
'
{
  "request_id": "4b2cd27e-0b0d-3dec-c31c-7572daf74bb3"
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

이 엔드포인트를 사용하면 텍스트만으로, 또는 텍스트와 하나의 원본 이미지를 함께 사용해 Grok 비디오 작업을 시작할 수 있습니다. request_id가 즉시 반환되므로 비동기 워크플로의 첫 단계로 취급하세요.

작은 요청으로 시작하기

  • model: grok-imagine-video 사용
  • 첫 요청에서는 duration1로, resolution480p로 유지하세요
  • 이미지-투-비디오를 원할 때만 image.url을 추가하세요
  • base64를 보낼 경우 문서와 OpenAPI 예시 형식은 data:image/png;base64,<BASE64_IMAGE_DATA>로 유지하세요

작업 흐름

1

작업 생성

프롬프트를 보내고 반환된 request_id를 저장하세요.
2

완료될 때까지 폴링

중첩된 provider status가 done이 될 때까지 비디오 생성 결과 가져오기를 호출하세요.
3

출력 저장

제공자의 임시 전달 기간 이후에도 필요하다면 최종 video.url을 자체 스토리지에 복사하세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

본문

application/json
prompt
string
필수

Prompt for the video job.

예시:

"A candle flickers on a wooden table."

aspect_ratio
enum<string>

Output aspect ratio.

사용 가능한 옵션:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
duration
integer
기본값:1

Output duration in seconds. xAI documents a range of 1 to 15 seconds.

image
object

Optional source image for image-to-video.

model
string
기본값:grok-imagine-video

xAI video model id.

예시:

"grok-imagine-video"

output
object
resolution
enum<string>

Output resolution.

사용 가능한 옵션:
480p,
720p
size
string

Deprecated size field. Prefer aspect_ratio and resolution.

user
string

Optional end-user identifier.

응답

200 - application/json

Request accepted.

request_id
string
필수

Deferred request id used for polling.