Skip to main content
POST
Gebruik dit endpoint om een Grok image-to-video-job te starten vanaf één bronafbeelding en een prompt. Het retourneert direct een request_id, dus behandel dit als de eerste stap in een async workflow.

Begin met een klein verzoek

  • Gebruik model: grok-imagine-video-1.5
  • Stel image.url in op een openbare JPEG-, PNG- of WebP-URL
  • Houd voor een eerste verzoek duration op 1 en resolution op 720p
  • Houd prompt expliciet zodat de animatierichting duidelijk is
  • Als je base64 verstuurt, houd dan de documentatie- en OpenAPI-voorbeeldvorm als data:image/png;base64,<BASE64_IMAGE_DATA>

Duration en resolution

Taakverloop

1

Maak de job

Verstuur de prompt en bronafbeelding en sla vervolgens de geretourneerde request_id op.
2

Poll op voltooiing

Roep xAI-videoresultaten ophalen aan totdat de geneste providerstatus done wordt.
3

Sla de uitvoer op

Kopieer de uiteindelijke video.url naar je eigen opslag als je die nodig hebt na de tijdelijke leveringsperiode van de provider.

Autorisaties

Authorization
string
header
vereist

Bearer token authentication. Use your CometAPI key.

Body

application/json
prompt
string
vereist

Prompt describing how the source image should animate. CometAPI requires this field for this route.

Voorbeeld:

"Animate the still image with a slow camera move and natural motion."

aspect_ratio
enum<string>

Output aspect ratio. Combine with resolution to choose the target frame; for example 480p with 1:1 targets 480x480, 720p with 16:9 targets 1280x720, and 720p with 9:16 targets 720x1280. This endpoint does not expose an exact size field.

Beschikbare opties:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
duration
integer
standaard:8

Output duration in seconds. Use an integer from 1 through 15. If omitted, CometAPI treats the request as an 8-second generation for billing and default handling.

image
object

Source image for image-to-video. Use a public JPEG, PNG, or WebP URL, or a data URI such as data:image/png;base64,<BASE64_IMAGE_DATA>.

model
string
standaard:grok-imagine-video-1.5

xAI video model id. The default example uses Grok Imagine 1.5 for image-to-video.

Voorbeeld:

"grok-imagine-video-1.5"

output
object
resolution
enum<string>
standaard:720p

Output resolution. Use 720p for a small image-to-video test, or 1080p when you need a higher resolution tier.

Beschikbare opties:
480p,
720p,
1080p
size
string

Deprecated size field. Prefer aspect_ratio and resolution.

user
string

Optional end-user identifier.

Respons

200 - application/json

Request accepted.

request_id
string
vereist

Deferred request id used for polling.