Grok Imagine Video API

Grok Imagine Video supports entertainment-oriented video generation, image-driven videos, video editing, and video extension workflows.

Model keys

  • gork/grok-imagine-video — Grok Imagine Video

Supported modes and inputs

Model Mode Label Input requirements
gork/grok-imagine-video text_to_video Text to Video Prompt max 2000 chars
gork/grok-imagine-video frames_to_video Frames to Video Prompt max 2000 chars
Images start_frame: 1-1 files, 10 MB, formats jpg, jpeg, png, webp
gork/grok-imagine-video reference_to_video Reference to Video Prompt max 2000 chars
Images reference: 1-7 files, 10 MB, formats jpg, jpeg, png, webp
gork/grok-imagine-video video_edit Video Edit Prompt max 2000 chars
Videos: 1-1 files, 100 MB, max 8.7s, formats mp4, mov, webm
gork/grok-imagine-video video_extension Video Extension Prompt max 2000 chars
Videos: 1-1 files, 100 MB, max 15s, formats mp4

Options

Model Option Default Allowed values Applies to
gork/grok-imagine-video duration 5s 1s, 2s, 3s, 4s, 5s, 6s, 7s, 8s, 9s, 10s, 11s, 12s, 13s, 14s, 15s text_to_video, frames_to_video, video_edit
gork/grok-imagine-video reference_to_video_durationduration 5s 1s, 2s, 3s, 4s, 5s, 6s, 7s, 8s, 9s, 10s reference_to_video
gork/grok-imagine-video video_extension_durationduration 5s 2s, 3s, 4s, 5s, 6s, 7s, 8s, 9s, 10s video_extension
gork/grok-imagine-video aspect_ratio 16:9 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3 text_to_video, frames_to_video, video_edit, reference_to_video
gork/grok-imagine-video resolution 480p 480p, 720p text_to_video, frames_to_video, video_edit, reference_to_video

Pricing

Model Pricing
gork/grok-imagine-video 4 credits per second

Production guidance

  • Pass mode explicitly.
  • Use only option values listed above.
  • Upload media with POST /api/v1/files before calling media-input modes.
  • Use the exact model key for the variant you want.

Example: text to video

curl https://img2vid.net/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gork/grok-imagine-video",
    "mode": "text_to_video",
    "prompt": "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
    "duration": "5s",
    "aspect_ratio": "16:9",
    "resolution": "480p"
  }'

Example: media-guided video

curl https://img2vid.net/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gork/grok-imagine-video",
    "mode": "reference_to_video",
    "prompt": "Animate the source into a polished cinematic motion shot with natural camera movement",
    "image_urls": ["https://example.com/reference.png"],
    "duration": "5s",
    "aspect_ratio": "16:9",
    "resolution": "480p"
  }'

SDK examples

The examples below use this page's public model key, mode, and parameter values. They assume you have already initialized the SDK client as shown in the Quickstart and imported the required language SDK types. For media-input modes, upload local files first and pass the returned URL through public fields such as image_urls, start_frame, or video_urls.

JavaScript / TypeScript

const task = await buble.generations.create({
  model: 'gork/grok-imagine-video',
  mode: 'text_to_video',
  prompt:
    'A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion',
  duration: '5s',
  aspect_ratio: '16:9',
  resolution: '480p',
});

const result = await buble.generations.wait(task.data.id);
console.log(result.data.result?.videos?.[0]?.url);

Python

task = client.generations.create(
    model="gork/grok-imagine-video",
    mode="text_to_video",
    prompt="A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
    duration="5s",
    aspect_ratio="16:9",
    resolution="480p",
)

result = client.generations.wait(task["data"]["id"])
print(result["data"]["result"]["videos"][0]["url"])

Go

task, err := client.Generations.Create(ctx, &buble.CreateGenerationRequest{
	Model:  "gork/grok-imagine-video",
	Mode:   "text_to_video",
	Prompt: "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
	Params: map[string]any{
		"duration": "5s",
		"aspect_ratio": "16:9",
		"resolution": "480p",
	},
})
if err != nil {
	return err
}

result, err := client.Generations.Wait(ctx, task.Data.ID)
if err != nil {
	return err
}
fmt.Println(result.Data.Result.Videos[0].URL)

Rust

let task = client.generations().create(
    CreateGenerationRequest::new("gork/grok-imagine-video")
        .mode("text_to_video")
        .prompt("A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion")
        .param("duration", "5s")?
        .param("aspect_ratio", "16:9")?
        .param("resolution", "480p")?,
).await?;

let result = client
    .generations()
    .wait(&task.data.id, WaitOptions::default())
    .await?;

Swift

let task = try await client.generations.create(
    try CreateGenerationRequest(model: "gork/grok-imagine-video")
        .mode("text_to_video")
        .prompt("A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion")
        .param("duration", "5s")
        .param("aspect_ratio", "16:9")
        .param("resolution", "480p")
)

let result = try await client.generations.wait(task.data.id)
print(result.data.result?.videos?.first?.url.absoluteString ?? "")

Dart / Flutter

final task = await client.generations.create(
  CreateGenerationRequest(
    model: 'gork/grok-imagine-video',
    mode: 'text_to_video',
    prompt: 'A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion',
  ).withParam('duration', '5s').withParam('aspect_ratio', '16:9').withParam('resolution', '480p'),
);

final result = await client.generations.wait(task.data.id);
print(result.data.result?.videos.firstOrNull?.url);

Elixir

{:ok, task} =
  Buble.Generations.create(client, %{
    model: "gork/grok-imagine-video",
    mode: "text_to_video",
    prompt: "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
    duration: "5s",
    aspect_ratio: "16:9",
    resolution: "480p"
  })

{:ok, result} = Buble.Generations.wait(client, task["data"]["id"])
IO.puts(result["data"]["result"]["videos"] |> List.first() |> Map.fetch!("url"))

Java

Envelope<GenerationTask> task = client.generations().create(
        CreateGenerationRequest.builder()
                .model("gork/grok-imagine-video")
                .mode("text_to_video")
                .prompt("A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion")
                .param("duration", "5s")
                .param("aspect_ratio", "16:9")
                .param("resolution", "480p")
                .build());

Envelope<GenerationTask> result = client.generations().wait(task.getData().getId());

.NET

var task = await client.Generations.CreateAsync(new CreateGenerationRequest
{
    Model = "gork/grok-imagine-video",
    Mode = "text_to_video",
    Prompt = "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion"
}.WithParam("duration", "5s").WithParam("aspect_ratio", "16:9").WithParam("resolution", "480p"));

var result = await client.Generations.WaitAsync(task!.Data!.Id!);

PHP

$task = $client->generations()->create(
    CreateGenerationRequest::make(
        model: 'gork/grok-imagine-video',
        mode: 'text_to_video',
        prompt: 'A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion',
    )
    ->withParam('duration', '5s')
    ->withParam('aspect_ratio', '16:9')
    ->withParam('resolution', '480p')
);

$result = $client->generations()->wait($task['data']['id']);

Ruby

task = client.generations.create(
  model: "gork/grok-imagine-video",
  mode: "text_to_video",
  prompt: "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
  duration: "5s",
  aspect_ratio: "16:9",
  resolution: "480p"
)

result = client.generations.wait(task.dig("data", "id"))
puts result.dig("data", "result", "videos", 0, "url")