Przejdź do głównej treści
GET
/
grok
/
v1
/
videos
/
{request_id}
Query an xAI video job
curl --request GET \
  --url https://api.cometapi.com/grok/v1/videos/{request_id} \
  --header 'Authorization: Bearer <token>'
{
  "request_id": "f5f35814-953e-b094-5a2c-4a90014a58cb"
}

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.

Użyj tego endpointu, gdy masz już request_id. Informuje on, czy zadanie xAI nadal jest wykonywane, i zwraca końcowe metadane wideo, gdy są gotowe.

Najpierw sprawdź te pola

  • request_id, gdy zadanie zostało zaakceptowane, ale wynik nie jest jeszcze gotowy
  • status dla stanu zadania xAI; kontynuuj odpytywanie, aż osiągnie done
  • progress dla procentu ukończenia, jeśli jest zwracany
  • video.url, gdy renderowanie jest zakończone

Pętla odpytywania

1

Najpierw utwórz lub edytuj wideo

Zacznij od Video Generation lub Video Edit, a następnie skopiuj zwrócony request_id.
2

Kontynuuj odpytywanie, aż status będzie done

Jeśli odpowiedź tylko zwraca request_id, odczekaj kilka sekund i odpytaj ponownie. Gdy pojawi się status, użyj go jako warunku zakończenia.
3

Zachowaj gotowy plik

Pobierz lub skopiuj końcowy video.url bez zwłoki, ponieważ xAI dokumentuje wygenerowane URL-e jako tymczasowe.

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Parametry ścieżki

request_id
string
wymagane

Deferred request id returned by the create or edit endpoint.

Odpowiedź

200 - application/json

Current xAI video task state.

request_id
string

Returned when the request is accepted but result metadata is not ready yet.

model
string

xAI video model id.

usage
object
video
object

Generated video metadata. Present when the job has completed.

status
enum<string>

xAI job state. done means the video metadata is ready.

Dostępne opcje:
queued,
processing,
done,
failed,
expired
progress
integer

Completion percentage when returned.

error

Error details when the job fails.