Vai al contenuto principale
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.

Usa questo endpoint per avviare un processo video Grok da testo, oppure da testo più un’immagine sorgente. Restituisce immediatamente un request_id, quindi trattalo come il primo passaggio di un flusso di lavoro asincrono.

Inizia con una richiesta piccola

  • Usa model: grok-imagine-video
  • Per una prima richiesta, mantieni duration a 1 e resolution a 480p
  • Aggiungi image.url solo quando vuoi usare image-to-video
  • Se invii base64, mantieni nei documenti e nell’esempio OpenAPI la forma data:image/png;base64,<BASE64_IMAGE_DATA>

Flusso dell’attività

1

Crea il processo

Invia il prompt e salva il request_id restituito.
2

Interroga fino al completamento

Chiama Get Video Generation Results finché lo stato del provider annidato non diventa done.
3

Salva l'output

Copia il video.url finale nel tuo sistema di archiviazione se ti serve dopo la finestra temporanea di consegna del provider.

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer token authentication. Use your CometAPI key.

Corpo

application/json
prompt
string
obbligatorio

Prompt for the video job.

Esempio:

"A candle flickers on a wooden table."

aspect_ratio
enum<string>

Output aspect ratio.

Opzioni disponibili:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
duration
integer
predefinito: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
predefinito:grok-imagine-video

xAI video model id.

Esempio:

"grok-imagine-video"

output
object
resolution
enum<string>

Output resolution.

Opzioni disponibili:
480p,
720p
size
string

Deprecated size field. Prefer aspect_ratio and resolution.

user
string

Optional end-user identifier.

Risposta

200 - application/json

Request accepted.

request_id
string
obbligatorio

Deferred request id used for polling.