Grok Video Generation
curl --request POST \
--url https://www.token-nova.com/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"aspect_ratio": "<string>",
"seconds": 123,
"size": "<string>"
}
'import requests
url = "https://www.token-nova.com/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"aspect_ratio": "<string>",
"seconds": 123,
"size": "<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({
model: '<string>',
prompt: '<string>',
aspect_ratio: '<string>',
seconds: 123,
size: '<string>'
})
};
fetch('https://www.token-nova.com/v1/videos', 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://www.token-nova.com/v1/videos",
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([
'model' => '<string>',
'prompt' => '<string>',
'aspect_ratio' => '<string>',
'seconds' => 123,
'size' => '<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://www.token-nova.com/v1/videos"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<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://www.token-nova.com/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/v1/videos")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "video_abc123",
"object": "video",
"model": "grok-video-3",
"status": "queued",
"progress": 0,
"created_at": 1735689600,
"size": "720P"
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "Invalid token",
"type": "new_api_error",
"param": "",
"code": "invalid_api_key"
}
}
OpenAI Format
Grok Video Generation
Use POST /v1/videos to invoke the Grok video series models and submit asynchronous generation tasks.
POST
https://www.token-nova.com
/
v1
/
videos
Grok Video Generation
curl --request POST \
--url https://www.token-nova.com/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"aspect_ratio": "<string>",
"seconds": 123,
"size": "<string>"
}
'import requests
url = "https://www.token-nova.com/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"aspect_ratio": "<string>",
"seconds": 123,
"size": "<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({
model: '<string>',
prompt: '<string>',
aspect_ratio: '<string>',
seconds: 123,
size: '<string>'
})
};
fetch('https://www.token-nova.com/v1/videos', 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://www.token-nova.com/v1/videos",
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([
'model' => '<string>',
'prompt' => '<string>',
'aspect_ratio' => '<string>',
'seconds' => 123,
'size' => '<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://www.token-nova.com/v1/videos"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<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://www.token-nova.com/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/v1/videos")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "video_abc123",
"object": "video",
"model": "grok-video-3",
"status": "queued",
"progress": 0,
"created_at": 1735689600,
"size": "720P"
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "Invalid token",
"type": "new_api_error",
"param": "",
"code": "invalid_api_key"
}
}
Grok Video Generation
OpenAI-format entry point. If you need to use the unified videoPOST /v1/video/create, see Create Video.
The Grok video generation API uses multipart/form-data for submission. Please organize the request according to the fields here.
- The endpoint path is
POST /v1/videos. input_referenceis the reference image field and supports uploading multiple images repeatedly.grok-video-3-prowill be automatically fixed to10seconds, andgrok-video-3-maxwill be automatically fixed to15seconds.- The base version
grok-video-3has no additional fixed-seconds logic and is processed according to the actual parameters passed.
Currently Available Models
grok-video-3grok-video-3-progrok-video-3-max
Method and Path
POST /v1/videos
Request Example
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=grok-video-3" \
-F "prompt=猫咪听歌摇头晃脑,下大雨" \
-F "aspect_ratio=2:3" \
-F "seconds=6" \
-F "size=720P" \
-F "input_reference=@reference.png"
import requests
with open("reference.png", "rb") as f:
resp = requests.post(
"https://www.token-nova.com/v1/videos",
headers={"Authorization": "Bearer YOUR_API_KEY"},
data={
"model": "grok-video-3",
"prompt": "猫咪听歌摇头晃脑,下大雨",
"aspect_ratio": "2:3",
"seconds": 6,
"size": "720P",
},
files={"input_reference": ("reference.png", f, "image/png")},
timeout=60,
)
print(resp.json())
const formData = new FormData();
formData.append("model", "grok-video-3");
formData.append("prompt", "猫咪听歌摇头晃脑,下大雨");
formData.append("aspect_ratio", "2:3");
formData.append("seconds", "6");
formData.append("size", "720P");
formData.append("input_reference", fileInput.files[0]);
const response = await fetch("https://www.token-nova.com/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
body: formData,
});
console.log(await response.json());
Response Example
{
"id": "video_abc123",
"object": "video",
"model": "grok-video-3",
"status": "queued",
"progress": 0,
"created_at": 1735689600,
"size": "720P"
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "Invalid token",
"type": "new_api_error",
"param": "",
"code": "invalid_api_key"
}
}
Authentication
Authorization: Bearer YOUR_API_KEY
Body
Model name. The currently available Grok series values are
grok-video-3, grok-video-3-pro, and grok-video-3-max.Target duration in seconds. For
grok-video-3-pro and grok-video-3-max, this will be automatically corrected to a fixed value.Reference image file. Can be passed multiple times, corresponding to multiple
input_reference uploads.Response
Use Cases
Text-to-Video
Just pass the fieldsmodel, prompt, seconds, and size.
Image-to-Video
On top of text-to-video, add one or moreinput_reference files.
Fixed-Duration Models
If you passgrok-video-3-pro or grok-video-3-max, expect the server to process them with a fixed duration.
