Grok Imagine 1.5 Video Generation
Async processing mode, returns task ID for subsequent queries
כל התיעוד/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-extfor this endpoint.
דוגמאות לבקשות
# 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
AuthorizationstringrequiredAll 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:
Authorization: Bearer YOUR_API_KEYRequest Parameters
modelstringrequireddefault: grok-imagine-1.5-video-extVideo 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-extconsistently in new requests.
nsfw_checkbooleandefault: falseWhether to run content moderation before submitting the video task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstringrequiredVideo content description, supports multiple languages
sizestringdefault: 16:9Video aspect ratio
Options:
16:9- Landscape (default)9:16- Portrait1:1- Square4:3- Landscape3:4- Portrait3:2- Landscape2:3- Portrait
durationintegerdefault: 6Video 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: 480pVideo quality
Options:
480p- Standard definition (default)720p- High definition1080p- Full HD
1080p limits:
- Only supports text-to-video, or first-frame-only mode (only a single
first_frameinimage_with_roles) - Reference images are not supported (any number of images in
image_urls, orreference_imageinimage_with_roles) - Last frame (
last_frameinimage_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_rolesif you need a first frame) 1080pnot 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 imagelast_frame- Last frame, at most 1 image;first_framemust also be providedreference_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
urlstringrequiredImage URL, only http(s) public URLs are supported (base64 is not supported), formats JPEG / PNG / WebP
rolestringrequiredImage role, must be lowercase:
first_frame- First framelast_frame- Last framereference_image- Reference image
Limits:
- At most 1 image each for
first_frameandlast_frame; at most 14 images forreference_image last_framemust be provided together withfirst_frame; last frame alone is not allowed1080pis supported only whenimage_with_rolescontains a singlefirst_frame- Cannot be used together with
image_urls
Example:
[
{"url": "https://example.com/day.jpg", "role": "first_frame"},
{"url": "https://example.com/night.jpg", "role": "last_frame"}
]Response
codeintegerResponse status code
dataobject[]Response data array
Properties
task_idstringUnique task identifier
statusstringTask status
submitted- Submitted
Note
Query Task Result
Video generation is an async task. After submission, a
task_idwill be returned. Use the Get Task Status endpoint to query generation progress and results.
Use Cases
Case 1: Text-to-Video
{
"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
{
"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)
{
"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)
{
"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)
{
"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)
{
"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 mode | Image parameter | Available resolutions | Duration |
|---|---|---|---|
| Text-to-video | Not provided | 480p / 720p / 1080p | 1~15 s |
| Reference-images-to-video | 1~14 images in image_urls, or only reference_image in image_with_roles | 480p / 720p | 1~15 s |
| First-frame-to-video | Only a single first_frame in image_with_roles | 480p / 720p / 1080p | 1~15 s |
| First-and-last-frame-to-video | first_frame + last_frame in image_with_roles | 480p / 720p | 1~15 s |
| First frame (+ last frame) + reference images | first_frame (optionally last_frame) + reference_image in image_with_roles | 480p / 720p | 1~15 s |
Common Parameter Errors
The following errors are returned at submission time; no task is created and no charge is incurred.
| HTTP | code | Reason |
|---|---|---|
| 400 | invalid_resolution | Resolution is not 480p / 720p / 1080p; or 1080p is combined with reference images or a last frame |
| 400 | invalid_duration | Duration exceeds 15 seconds |
| 400 | invalid_image_with_roles | Provided 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 |
| 400 | invalid_image_urls | More than 14 reference images (image_urls or reference_image combined) |
| 400 | invalid_request_error | Image is base64 or not an http(s) URL |
| 403 | model_price_not_configured | 1080p is not yet available |
תגובות
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}מודלים המשתמשים בנקודת קצה זו
מצאתם בעיה בתיעוד? אפשר לשלוח אימייל לכתובת support@apisea.ai.