메인 콘텐츠로 건너뛰기
POST
/
grok
/
v1
/
videos
/
edits
Create an xAI video edit job
curl --request POST \
  --url https://api.cometapi.com/grok/v1/videos/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Add snow to the scene.",
  "video": {
    "url": "https://example.com/source.mp4"
  }
}
'
{
  "request_id": "e55813f7-911f-cfa8-208c-9c8e693b4d38"
}
이 엔드포인트를 사용하면 텍스트 지시로 기존 MP4를 편집할 수 있습니다. 출력 결과는 새 생성 요청보다 원본 클립의 타이밍과 구도에 더 가깝게 유지됩니다.

요청을 보내기 전에

  • 접근 가능한 video.url을 제공하세요
  • 원본 클립은 짧게 유지하세요. xAI의 자체 가이드에서는 편집 길이를 약 8.7초로 제한합니다
  • 하나의 명확한 변경 사항을 설명하는 집중된 지시를 사용하세요
  • 편집은 생성과 동일한 폴링 흐름을 사용하므로 반환된 request_id를 저장하세요

편집 흐름

1

편집 요청 제출

원본 비디오 URL, 편집 프롬프트, 그리고 model: grok-imagine-video를 전송하세요.
2

최종 결과 폴링

작업이 완료될 때까지 비디오 생성 결과 가져오기를 호출하세요.
3

편집된 자산 저장

완성된 출력물을 다운로드하거나 반환된 URL을 자체 스토리지 파이프라인으로 이동하세요.

CometAPI에서 달라지는 점

xAI는 비디오 편집을 생성과 동일한 비동기 수명 주기로 문서화하며, 선택적 원본 이미지 대신 원본 비디오를 사용한다는 점만 다릅니다. CometAPI는 이 동작과 동일한 폴링 엔드포인트를 유지하므로, 편집 워크플로는 여전히 시작 -> 폴링 -> 다운로드입니다.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

본문

application/json
prompt
string
필수

Edit instruction describing the change you want.

예시:

"Add snow to the scene."

video
object
필수

Source video to edit. xAI documents an input limit of about 8.7 seconds.

model
string
기본값:grok-imagine-video

xAI video model id.

예시:

"grok-imagine-video"

output
object

Optional output delivery configuration.

user
string

Optional end-user identifier.

응답

200 - application/json

Request accepted.

request_id
string
필수

Deferred request id used for polling.