curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "A rainy neon-lit street at night, a vintage sports car driving over the wet road",
"seconds": "8",
"aspect_ratio": "16:9",
"resolution": "720P"
}'
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "Have the person in the reference image turn around slowly, with natural light flowing in the background",
"seconds": "6",
"aspect_ratio": "9:16",
"resolution": "720P",
"image": "data:image/png;base64,BASE64_IMAGE_DATA"
}'
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "Keep the subject consistent and generate a video transitioning from the first image to the second",
"seconds": "10",
"aspect_ratio": "16:9",
"resolution": "720P",
"images": [
"data:image/png;base64,FIRST_IMAGE_BASE64",
"data:image/png;base64,SECOND_IMAGE_BASE64"
]
}'
import base64
import requests
def to_data_url(path, mime="image/png"):
with open(path, "rb") as f:
encoded = base64.b64encode(f.read()).decode("ascii")
return f"data:{mime};base64,{encoded}"
resp = requests.post(
"https://www.token-nova.com/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "grok-imagine-video-1.5-preview",
"prompt": "Have the person in the reference image smile at the camera, with hair and clothing swaying slightly",
"seconds": "6",
"aspect_ratio": "16:9",
"resolution": "720P",
"image": to_data_url("reference.png"),
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://www.token-nova.com/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "grok-imagine-video-1.5-preview",
prompt: "Have the person in the reference image smile at the camera, with hair and clothing swaying slightly",
seconds: "6",
aspect_ratio: "16:9",
resolution: "720P",
image: "data:image/png;base64,BASE64_IMAGE_DATA",
}),
});
console.log(await response.json());
{
"id": "video_abc123",
"object": "video",
"model": "grok-imagine-video-1.5-preview",
"status": "queued",
"progress": 0,
"created_at": 1735689600,
"seconds": "6",
"size": "720P",
"video_url": ""
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "prompt",
"code": "invalid_request"
}
}
OpenAI Format
Grok Imagine 1.5 Preview
Use POST /v1/videos with the grok-imagine-video-1.5-preview model to submit JSON video generation tasks.
POST
https://www.token-nova.com
/
v1
/
videos
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "A rainy neon-lit street at night, a vintage sports car driving over the wet road",
"seconds": "8",
"aspect_ratio": "16:9",
"resolution": "720P"
}'
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "Have the person in the reference image turn around slowly, with natural light flowing in the background",
"seconds": "6",
"aspect_ratio": "9:16",
"resolution": "720P",
"image": "data:image/png;base64,BASE64_IMAGE_DATA"
}'
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "Keep the subject consistent and generate a video transitioning from the first image to the second",
"seconds": "10",
"aspect_ratio": "16:9",
"resolution": "720P",
"images": [
"data:image/png;base64,FIRST_IMAGE_BASE64",
"data:image/png;base64,SECOND_IMAGE_BASE64"
]
}'
import base64
import requests
def to_data_url(path, mime="image/png"):
with open(path, "rb") as f:
encoded = base64.b64encode(f.read()).decode("ascii")
return f"data:{mime};base64,{encoded}"
resp = requests.post(
"https://www.token-nova.com/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "grok-imagine-video-1.5-preview",
"prompt": "Have the person in the reference image smile at the camera, with hair and clothing swaying slightly",
"seconds": "6",
"aspect_ratio": "16:9",
"resolution": "720P",
"image": to_data_url("reference.png"),
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://www.token-nova.com/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "grok-imagine-video-1.5-preview",
prompt: "Have the person in the reference image smile at the camera, with hair and clothing swaying slightly",
seconds: "6",
aspect_ratio: "16:9",
resolution: "720P",
image: "data:image/png;base64,BASE64_IMAGE_DATA",
}),
});
console.log(await response.json());
{
"id": "video_abc123",
"object": "video",
"model": "grok-imagine-video-1.5-preview",
"status": "queued",
"progress": 0,
"created_at": 1735689600,
"seconds": "6",
"size": "720P",
"video_url": ""
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "prompt",
"code": "invalid_request"
}
}
Grok Imagine 1.5 Preview
grok-imagine-video-1.5-preview is the JSON video generation model of the Grok 1.5 series. Unlike the grok-video-1.5 series, this model passes reference images through JSON fields.
- The endpoint path is
POST /v1/videos. - The request format is
application/json. - Text-to-video only requires
model,prompt,seconds,aspect_ratio, andresolution. - For image-to-video, use
imagefor a single image andimagesfor multiple images. resolutionsupports480Pand720P.
Method and Path
POST /v1/videos
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "A rainy neon-lit street at night, a vintage sports car driving over the wet road",
"seconds": "8",
"aspect_ratio": "16:9",
"resolution": "720P"
}'
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "Have the person in the reference image turn around slowly, with natural light flowing in the background",
"seconds": "6",
"aspect_ratio": "9:16",
"resolution": "720P",
"image": "data:image/png;base64,BASE64_IMAGE_DATA"
}'
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5-preview",
"prompt": "Keep the subject consistent and generate a video transitioning from the first image to the second",
"seconds": "10",
"aspect_ratio": "16:9",
"resolution": "720P",
"images": [
"data:image/png;base64,FIRST_IMAGE_BASE64",
"data:image/png;base64,SECOND_IMAGE_BASE64"
]
}'
import base64
import requests
def to_data_url(path, mime="image/png"):
with open(path, "rb") as f:
encoded = base64.b64encode(f.read()).decode("ascii")
return f"data:{mime};base64,{encoded}"
resp = requests.post(
"https://www.token-nova.com/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "grok-imagine-video-1.5-preview",
"prompt": "Have the person in the reference image smile at the camera, with hair and clothing swaying slightly",
"seconds": "6",
"aspect_ratio": "16:9",
"resolution": "720P",
"image": to_data_url("reference.png"),
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://www.token-nova.com/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "grok-imagine-video-1.5-preview",
prompt: "Have the person in the reference image smile at the camera, with hair and clothing swaying slightly",
seconds: "6",
aspect_ratio: "16:9",
resolution: "720P",
image: "data:image/png;base64,BASE64_IMAGE_DATA",
}),
});
console.log(await response.json());
Response Example
{
"id": "video_abc123",
"object": "video",
"model": "grok-imagine-video-1.5-preview",
"status": "queued",
"progress": 0,
"created_at": 1735689600,
"seconds": "6",
"size": "720P",
"video_url": ""
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "prompt",
"code": "invalid_request"
}
}
Authentication
Authorization: Bearer YOUR_API_KEY
Body
Target duration in seconds. Minimum is
1 second; passing it as a string is recommended, e.g. "6".Aspect ratio. Supports common presets
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, as well as custom number:number ratios.Multiple reference images. Each array member is a data URI such as
data:image/png;base64,.... Do not pass image together with images.Response
Video URL after the task completes. You can also download the result with
GET /v1/videos/{task_id}/content.Differences from Grok 1.5
| Item | grok-imagine-video-1.5-preview | grok-video-1.5 / pro / max |
|---|---|---|
| Request format | JSON | multipart/form-data |
| Image field | image / images | input_reference |
| Resolution field | resolution | size |
| Resolution values | 480P, 720P | 480P, 540P, 720P, 1080P |
| Duration rules | Custom seconds, min 1s | 10s for Pro, 15s for Max |
