Grok Imagine Video
curl --request POST \
--url https://open.skills.video/api/v1/generation/xai/grok-imagine-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"feature": "<string>",
"prompt": "<string>",
"video_url": "<string>"
}
'import requests
url = "https://open.skills.video/api/v1/generation/xai/grok-imagine-video"
payload = {
"feature": "<string>",
"prompt": "<string>",
"video_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({feature: '<string>', prompt: '<string>', video_url: '<string>'})
};
fetch('https://open.skills.video/api/v1/generation/xai/grok-imagine-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.skills.video/api/v1/generation/xai/grok-imagine-video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'feature' => '<string>',
'prompt' => '<string>',
'video_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://open.skills.video/api/v1/generation/xai/grok-imagine-video"
payload := strings.NewReader("{\n \"feature\": \"<string>\",\n \"prompt\": \"<string>\",\n \"video_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://open.skills.video/api/v1/generation/xai/grok-imagine-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"feature\": \"<string>\",\n \"prompt\": \"<string>\",\n \"video_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://open.skills.video/api/v1/generation/xai/grok-imagine-video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"feature\": \"<string>\",\n \"prompt\": \"<string>\",\n \"video_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"feature": "<string>",
"prompt": "<string>",
"video_url": "<string>"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://open.skills.video/api/v1/generation/xai/grok-imagine-video")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self)){
"id": "gen_123",
"status": "IN_QUEUE",
"input": {
"prompt": "a cat walking through neon rain",
"duration": 5,
"aspect_ratio": "16:9",
"n": 1
},
"usage": {
"total": 20,
"subscription": 20,
"permanent": 0
}
}{
"error": "VIDEO_GENERATION_INVALID_INPUT",
"code": "VIDEO_GENERATION_INVALID_INPUT",
"message": "'prompt' parameter is required"
}{
"error": "UNAUTHORIZED",
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}{
"error": "INSUFFICIENT_CREDITS",
"code": "VIDEO_GENERATION_INSUFFICIENT_CREDITS",
"message": "Insufficient credits for this generation."
}{
"error": "WORKSPACE_FORBIDDEN",
"code": "WORKSPACE_FORBIDDEN",
"message": "You do not have access to this workspace."
}{
"error": "TEMPLATE_NOT_FOUND",
"code": "TEMPLATE_NOT_FOUND",
"message": "Template not found."
}{
"error": "VIDEO_GENERATION_CONTENT_REJECTED",
"code": "VIDEO_GENERATION_CONTENT_REJECTED",
"message": "Request content was rejected by the moderation policy."
}{
"error": "VIDEO_GENERATION_RATE_LIMITED",
"code": "VIDEO_GENERATION_RATE_LIMITED",
"message": "Rate limit exceeded. Please retry later."
}{
"error": "VIDEO_GENERATION_FAILED",
"code": "VIDEO_GENERATION_FAILED",
"message": "Generation failed."
}{
"error": "VIDEO_GENERATION_FAILED",
"code": "VIDEO_GENERATION_FAILED",
"message": "Generation failed."
}{
"error": "VIDEO_GENERATION_PROVIDER_UNAVAILABLE",
"code": "VIDEO_GENERATION_PROVIDER_UNAVAILABLE",
"message": "Upstream generation provider is temporarily unavailable."
}{
"error": "VIDEO_GENERATION_TIMEOUT",
"code": "VIDEO_GENERATION_TIMEOUT",
"message": "Generation timed out."
}xAI
Grok Imagine Video
POST
/
generation
/
xai
/
grok-imagine-video
Grok Imagine Video
curl --request POST \
--url https://open.skills.video/api/v1/generation/xai/grok-imagine-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"feature": "<string>",
"prompt": "<string>",
"video_url": "<string>"
}
'import requests
url = "https://open.skills.video/api/v1/generation/xai/grok-imagine-video"
payload = {
"feature": "<string>",
"prompt": "<string>",
"video_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({feature: '<string>', prompt: '<string>', video_url: '<string>'})
};
fetch('https://open.skills.video/api/v1/generation/xai/grok-imagine-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.skills.video/api/v1/generation/xai/grok-imagine-video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'feature' => '<string>',
'prompt' => '<string>',
'video_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://open.skills.video/api/v1/generation/xai/grok-imagine-video"
payload := strings.NewReader("{\n \"feature\": \"<string>\",\n \"prompt\": \"<string>\",\n \"video_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://open.skills.video/api/v1/generation/xai/grok-imagine-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"feature\": \"<string>\",\n \"prompt\": \"<string>\",\n \"video_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://open.skills.video/api/v1/generation/xai/grok-imagine-video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"feature\": \"<string>\",\n \"prompt\": \"<string>\",\n \"video_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"feature": "<string>",
"prompt": "<string>",
"video_url": "<string>"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://open.skills.video/api/v1/generation/xai/grok-imagine-video")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self)){
"id": "gen_123",
"status": "IN_QUEUE",
"input": {
"prompt": "a cat walking through neon rain",
"duration": 5,
"aspect_ratio": "16:9",
"n": 1
},
"usage": {
"total": 20,
"subscription": 20,
"permanent": 0
}
}{
"error": "VIDEO_GENERATION_INVALID_INPUT",
"code": "VIDEO_GENERATION_INVALID_INPUT",
"message": "'prompt' parameter is required"
}{
"error": "UNAUTHORIZED",
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}{
"error": "INSUFFICIENT_CREDITS",
"code": "VIDEO_GENERATION_INSUFFICIENT_CREDITS",
"message": "Insufficient credits for this generation."
}{
"error": "WORKSPACE_FORBIDDEN",
"code": "WORKSPACE_FORBIDDEN",
"message": "You do not have access to this workspace."
}{
"error": "TEMPLATE_NOT_FOUND",
"code": "TEMPLATE_NOT_FOUND",
"message": "Template not found."
}{
"error": "VIDEO_GENERATION_CONTENT_REJECTED",
"code": "VIDEO_GENERATION_CONTENT_REJECTED",
"message": "Request content was rejected by the moderation policy."
}{
"error": "VIDEO_GENERATION_RATE_LIMITED",
"code": "VIDEO_GENERATION_RATE_LIMITED",
"message": "Rate limit exceeded. Please retry later."
}{
"error": "VIDEO_GENERATION_FAILED",
"code": "VIDEO_GENERATION_FAILED",
"message": "Generation failed."
}{
"error": "VIDEO_GENERATION_FAILED",
"code": "VIDEO_GENERATION_FAILED",
"message": "Generation failed."
}{
"error": "VIDEO_GENERATION_PROVIDER_UNAVAILABLE",
"code": "VIDEO_GENERATION_PROVIDER_UNAVAILABLE",
"message": "Upstream generation provider is temporarily unavailable."
}{
"error": "VIDEO_GENERATION_TIMEOUT",
"code": "VIDEO_GENERATION_TIMEOUT",
"message": "Generation timed out."
}Unified Grok Imagine workflow for text/image generation, video extension, and video editing.
Authorizations
API Key for API endpoints
Body
application/jsonmultipart/form-data
- Text/Image
- Extend Video
- Edit Video
Workflow type: text/image-to-video, extend-video, or edit-video.
Allowed value:
"text-image"Prompt text for generation, continuation, or editing.
Optional image URL used in text-image mode.
Source video URL for extend-video and edit-video modes.
Output duration in seconds.
Required range:
1 <= x <= 15Output resolution. text-image supports 480p/720p; edit-video also supports auto.
Available options:
720p, 480p Aspect ratio for text-image generation.
Available options:
16:9, 9:16, 1:1, 3:4, 4:3, 2:3, 3:2 Required range:
1 <= x <= 4Response
Generation submission accepted
Generation id.
Queue status
Available options:
IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELED Normalized input payload for the generation task.
- Text/Image
- Extend Video
- Edit Video
Show child attributes
Show child attributes
Credit usage breakdown for the request
Show child attributes
Show child attributes
Machine-readable generation error code. Present when status is FAILED.
Sanitized human-readable failure message. Present when status is FAILED.
⌘I