Grok Image-to-Video
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/grok-image-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_urls": [
""
],
"mode": "normal",
"prompt": "The person waves and smiles"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/grok-image-to-video"
payload = {
"image_urls": [""],
"mode": "normal",
"prompt": "The person waves and smiles"
}
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({image_urls: [''], mode: 'normal', prompt: 'The person waves and smiles'})
};
fetch('https://api.sinancode.com/v1/generate/k/grok-image-to-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://api.sinancode.com/v1/generate/k/grok-image-to-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([
'image_urls' => [
''
],
'mode' => 'normal',
'prompt' => 'The person waves and smiles'
]),
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://api.sinancode.com/v1/generate/k/grok-image-to-video"
payload := strings.NewReader("{\n \"image_urls\": [\n \"\"\n ],\n \"mode\": \"normal\",\n \"prompt\": \"The person waves and smiles\"\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://api.sinancode.com/v1/generate/k/grok-image-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_urls\": [\n \"\"\n ],\n \"mode\": \"normal\",\n \"prompt\": \"The person waves and smiles\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/grok-image-to-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 \"image_urls\": [\n \"\"\n ],\n \"mode\": \"normal\",\n \"prompt\": \"The person waves and smiles\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}Video Generation - Grok
Grok Image-to-Video
Generate videos from images using xAI Grok model (async)
POST
/
generate
/
k
/
grok-image-to-video
Grok Image-to-Video
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/grok-image-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_urls": [
""
],
"mode": "normal",
"prompt": "The person waves and smiles"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/grok-image-to-video"
payload = {
"image_urls": [""],
"mode": "normal",
"prompt": "The person waves and smiles"
}
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({image_urls: [''], mode: 'normal', prompt: 'The person waves and smiles'})
};
fetch('https://api.sinancode.com/v1/generate/k/grok-image-to-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://api.sinancode.com/v1/generate/k/grok-image-to-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([
'image_urls' => [
''
],
'mode' => 'normal',
'prompt' => 'The person waves and smiles'
]),
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://api.sinancode.com/v1/generate/k/grok-image-to-video"
payload := strings.NewReader("{\n \"image_urls\": [\n \"\"\n ],\n \"mode\": \"normal\",\n \"prompt\": \"The person waves and smiles\"\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://api.sinancode.com/v1/generate/k/grok-image-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_urls\": [\n \"\"\n ],\n \"mode\": \"normal\",\n \"prompt\": \"The person waves and smiles\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/grok-image-to-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 \"image_urls\": [\n \"\"\n ],\n \"mode\": \"normal\",\n \"prompt\": \"The person waves and smiles\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}Transform static images into dynamic videos using xAI’s Grok Imagine model.
Key Features:
- Image Animation - Transform static images into professional-grade short videos
- Audio-Video Sync - Automatically generate matching sound effects, dialogue, and even singing
- Smooth Motion - 24fps framerate with natural, jitter-free movement
- Fast Output - Complete generation within 15 seconds
Authorizations
Please use your API Token for authentication
Body
application/json
Task parameters
Response
OK
Task ID
Example:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I