Skip to content
Diese Seite ist noch nicht in Ihrer Sprache verfügbar und wird deshalb auf Englisch angezeigt.

Grok Imagine 1.5 Video Generation

Async processing mode, returns task ID for subsequent queries

Gesamte Dokumentation
POST/v1/videos/generations
  • High-quality AI video generation, supports text-to-video, reference-images-to-video, and first-frame / first-and-last-frame to video
  • Supports 480p / 720p / 1080p resolution
  • Flexible aspect ratio and quality options for different creative needs

Note

Model name: Use grok-imagine-1.5-video-ext for this endpoint.

Anfragebeispiele

# Set model to "grok-imagine-1.5-video-ext"
curl --request POST \
  --url https://api.apisea.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.5-video-ext",
    "prompt": "A dog running on the beach, sunny weather, slow motion",
    "size": "16:9",
    "duration": 6,
    "resolution": "720p"
  }'

Authorizations

Authorizationstringrequired

All APIs require Bearer Token authentication

Get API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

text
Authorization: Bearer YOUR_API_KEY

Request Parameters

modelstringrequireddefault: grok-imagine-1.5-video-ext

Video generation model name

Supported models:

  • grok-imagine-1.5-video-ext - Grok Video Generation

Example: "grok-imagine-1.5-video-ext"

Note

Use grok-imagine-1.5-video-ext consistently in new requests.

nsfw_checkbooleandefault: false

Whether to run content moderation before submitting the video task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstringrequired

Video content description, supports multiple languages

sizestringdefault: 16:9

Video aspect ratio

Options:

  • 16:9 - Landscape (default)
  • 9:16 - Portrait
  • 1:1 - Square
  • 4:3 - Landscape
  • 3:4 - Portrait
  • 3:2 - Landscape
  • 2:3 - Portrait
durationintegerdefault: 6

Video duration (seconds)

Range: 1-15 seconds, defaults to 6 seconds if omitted

⚠️ Note: Must be a plain number (e.g. 6), do not add quotes, otherwise an error will occur

resolutionstringdefault: 480p

Video quality

Options:

  • 480p - Standard definition (default)
  • 720p - High definition
  • 1080p - Full HD

1080p limits:

  • Only supports text-to-video, or first-frame-only mode (only a single first_frame in image_with_roles)
  • Reference images are not supported (any number of images in image_urls, or reference_image in image_with_roles)
  • Last frame (last_frame in image_with_roles) is not supported
  • Duration up to 15 seconds
image_urlsstring[]

List of reference images (reference-images-to-video)

  • 1~14 images, all used as reference images (even a single image is a reference image, not a first frame; use image_with_roles if you need a first frame)
  • 1080p not supported

Limits:

  • Maximum 14 images
  • Only http(s) public URLs are supported; base64 is not supported (upload local images first to obtain a URL)
  • Formats: JPEG / PNG / WebP
  • Cannot be used together with image_with_roles
image_with_rolesobject[]

Images passed by role; role can be:

  • first_frame - First frame, at most 1 image
  • last_frame - Last frame, at most 1 image; first_frame must also be provided
  • reference_image - Reference image (not used as first/last frame), at most 14 images

The three roles can be combined freely (except last frame alone); when used, duration is up to 15 seconds; 1080p is not supported with a last frame or reference images.

Properties

urlstringrequired

Image URL, only http(s) public URLs are supported (base64 is not supported), formats JPEG / PNG / WebP

rolestringrequired

Image role, must be lowercase:

  • first_frame - First frame
  • last_frame - Last frame
  • reference_image - Reference image

Limits:

  • At most 1 image each for first_frame and last_frame; at most 14 images for reference_image
  • last_frame must be provided together with first_frame; last frame alone is not allowed
  • 1080p is supported only when image_with_roles contains a single first_frame
  • Cannot be used together with image_urls

Example:

json
[
  {"url": "https://example.com/day.jpg", "role": "first_frame"},
  {"url": "https://example.com/night.jpg", "role": "last_frame"}
]

Response

codeinteger

Response status code

dataobject[]

Response data array

Properties

task_idstring

Unique task identifier

statusstring

Task status

  • submitted - Submitted

Note

Query Task Result

Video generation is an async task. After submission, a task_id will be returned. Use the Get Task Status endpoint to query generation progress and results.

Use Cases

Case 1: Text-to-Video

json
{
  "model": "grok-imagine-1.5-video-ext",
  "prompt": "A dog running on the beach, sunny weather, slow motion",
  "size": "16:9",
  "duration": 6
}

Case 2: 1080p Text-to-Video

json
{
  "model": "grok-imagine-1.5-video-ext",
  "prompt": "Waves crashing against the rocks, slow motion",
  "size": "16:9",
  "duration": 8,
  "resolution": "1080p"
}

Case 3: Reference-Images-to-Video (1~14 images, 1080p not supported)

json
{
  "model": "grok-imagine-1.5-video-ext",
  "prompt": "Two cards placed on a table",
  "image_urls": [
    "https://example.com/a.png",
    "https://example.com/b.png"
  ],
  "resolution": "720p"
}

Case 4: First-Frame-to-Video (1080p)

json
{
  "model": "grok-imagine-1.5-video-ext",
  "prompt": "The person slowly turns their head and smiles",
  "duration": 5,
  "resolution": "1080p",
  "image_with_roles": [
    {"url": "https://example.com/portrait.jpg", "role": "first_frame"}
  ]
}

Case 5: First-and-Last-Frame-to-Video (1080p not supported)

json
{
  "model": "grok-imagine-1.5-video-ext",
  "prompt": "A street in daytime gradually turns into night",
  "duration": 5,
  "resolution": "720p",
  "image_with_roles": [
    {"url": "https://example.com/day.jpg", "role": "first_frame"},
    {"url": "https://example.com/night.jpg", "role": "last_frame"}
  ]
}

Case 6: First Frame + Reference Image (1080p not supported)

json
{
  "model": "grok-imagine-1.5-video-ext",
  "prompt": "The person picks up the cup on the table",
  "duration": 6,
  "resolution": "720p",
  "image_with_roles": [
    {"url": "https://example.com/portrait.jpg", "role": "first_frame"},
    {"url": "https://example.com/cup.png", "role": "reference_image"}
  ]
}

Parameter Combination Rules

Generation modeImage parameterAvailable resolutionsDuration
Text-to-videoNot provided480p / 720p / 1080p1~15 s
Reference-images-to-video1~14 images in image_urls, or only reference_image in image_with_roles480p / 720p1~15 s
First-frame-to-videoOnly a single first_frame in image_with_roles480p / 720p / 1080p1~15 s
First-and-last-frame-to-videofirst_frame + last_frame in image_with_roles480p / 720p1~15 s
First frame (+ last frame) + reference imagesfirst_frame (optionally last_frame) + reference_image in image_with_roles480p / 720p1~15 s

Common Parameter Errors

The following errors are returned at submission time; no task is created and no charge is incurred.

HTTPcodeReason
400invalid_resolutionResolution is not 480p / 720p / 1080p; or 1080p is combined with reference images or a last frame
400invalid_durationDuration exceeds 15 seconds
400invalid_image_with_rolesProvided together with image_urls; only a last frame; role is not first_frame / last_frame / reference_image; more than 1 first frame or last frame; empty url
400invalid_image_urlsMore than 14 reference images (image_urls or reference_image combined)
400invalid_request_errorImage is base64 or not an http(s) URL
403model_price_not_configured1080p is not yet available

Antworten

{
  "code": 200,
  "data": [
    {
      "task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
      "status": "submitted"
    }
  ]
}

Einen Fehler in dieser Dokumentation gefunden? Schreiben Sie an support@apisea.ai.