Grok Imagine Image to Video
curl --request POST \
--url https://whollyapi.com/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"image_urls": [
"<string>"
],
"prompt": "<string>",
"mode": "<string>",
"duration": "<string>",
"resolution": "<string>",
"aspect_ratio": "<string>"
}
}
'import requests
url = "https://whollyapi.com/api/v1/jobs/createTask"
payload = {
"model": "<string>",
"input": {
"image_urls": ["<string>"],
"prompt": "<string>",
"mode": "<string>",
"duration": "<string>",
"resolution": "<string>",
"aspect_ratio": "<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>',
input: {
image_urls: ['<string>'],
prompt: '<string>',
mode: '<string>',
duration: '<string>',
resolution: '<string>',
aspect_ratio: '<string>'
}
})
};
fetch('https://whollyapi.com/api/v1/jobs/createTask', 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://whollyapi.com/api/v1/jobs/createTask",
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>',
'input' => [
'image_urls' => [
'<string>'
],
'prompt' => '<string>',
'mode' => '<string>',
'duration' => '<string>',
'resolution' => '<string>',
'aspect_ratio' => '<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://whollyapi.com/api/v1/jobs/createTask"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {\n \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"mode\": \"<string>\",\n \"duration\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\"\n }\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://whollyapi.com/api/v1/jobs/createTask")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {\n \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"mode\": \"<string>\",\n \"duration\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whollyapi.com/api/v1/jobs/createTask")
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 \"input\": {\n \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"mode\": \"<string>\",\n \"duration\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"taskId": "<string>"
}
}Grok Imagine
Grok Imagine Image to Video
API reference for creating image-to-video generation tasks
POST
/
api
/
v1
/
jobs
/
createTask
Grok Imagine Image to Video
curl --request POST \
--url https://whollyapi.com/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"image_urls": [
"<string>"
],
"prompt": "<string>",
"mode": "<string>",
"duration": "<string>",
"resolution": "<string>",
"aspect_ratio": "<string>"
}
}
'import requests
url = "https://whollyapi.com/api/v1/jobs/createTask"
payload = {
"model": "<string>",
"input": {
"image_urls": ["<string>"],
"prompt": "<string>",
"mode": "<string>",
"duration": "<string>",
"resolution": "<string>",
"aspect_ratio": "<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>',
input: {
image_urls: ['<string>'],
prompt: '<string>',
mode: '<string>',
duration: '<string>',
resolution: '<string>',
aspect_ratio: '<string>'
}
})
};
fetch('https://whollyapi.com/api/v1/jobs/createTask', 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://whollyapi.com/api/v1/jobs/createTask",
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>',
'input' => [
'image_urls' => [
'<string>'
],
'prompt' => '<string>',
'mode' => '<string>',
'duration' => '<string>',
'resolution' => '<string>',
'aspect_ratio' => '<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://whollyapi.com/api/v1/jobs/createTask"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {\n \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"mode\": \"<string>\",\n \"duration\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\"\n }\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://whollyapi.com/api/v1/jobs/createTask")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {\n \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"mode\": \"<string>\",\n \"duration\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whollyapi.com/api/v1/jobs/createTask")
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 \"input\": {\n \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"mode\": \"<string>\",\n \"duration\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"taskId": "<string>"
}
}Create a video generation task using the
grok-imagine/image-to-video model.
Authentication
All API requests require a Bearer token.Authorization: Bearer YOUR_API_KEY
Request Body
Top-level fields
string
required
Must be
grok-imagine/image-to-video.object
required
Input parameters for the video generation task.
string[]
External reference image URLs. Supports JPEG, PNG, and WEBP. Each image can be up to 10 MB. Do not use together with
task_id.Use @image(n) in the prompt to reference an uploaded image, for example @image1 a sunset over the ocean.Only one image is supported at 1080p. Spicy mode is unavailable when using external images.string
Optional English-language prompt describing motion, actions, camera work, timing, environment, and motion dynamics. Maximum length: 5000 characters.
string
default:"normal"
Generation mode:
fun— more creative and playful interpretationnormal— balanced motion qualityspicy— more dynamic and intense motion effects; unavailable for external images
string
Generated video duration in seconds. Supported range:
6–30, in one-second steps.string
default:"480p"
Supported values:
480p, 720p, 1080p.string
default:"16:9"
Applies to multi-image generation. In single-image mode, video dimensions follow the source image dimensions.Supported values:
2:3, 3:2, 1:1, 16:9, 9:16.Request Example
{
"model": "grok-imagine/image-to-video",
"input": {
"image_urls": [
"https://demo.com/17622476923735116.png"
],
"prompt": "POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: \"thanks! Back to work\" she exits the frame and walks right to a different part of the office.",
"mode": "normal",
"duration": "6",
"resolution": "480p",
"aspect_ratio": "16:9"
}
}
Response
Successful Response
number
Response status code.
string
Response message. Contains the error description when the request fails.Example:
successobject
required
The task data object containing task id.
string
required
The unique identifier for this task.Example:
task_123456Query Task Status
After submitting a task, use the unified query endpoint to check the task progress and retrieve the generated results.Get Task Details
Check task status, monitor generation progress, and retrieve results.
Error Response
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}
Response Codes
| Code | Meaning |
|---|---|
200 | Success — the request was successfully processed. |
401 | Unauthorized — authentication credentials are missing or invalid. |
402 | Insufficient Credits — the account does not have enough credits. |
404 | Not Found — the requested resource or interface does not exist. |
408 | Upstream service issue — no result has been returned for over 10 minutes. |
422 | Validation Error — request parameters failed validation. |
429 | Rate Limited — request frequency limit has been exceeded. |
433 | Request Limit — sub-key usage exceeded the limit. |
455 | Service Unavailable — system is undergoing maintenance. |
500 | Server Error — an unexpected error occurred while processing the request. |
501 | Generation Failed — content generation failed. |
505 | Feature Disabled — the requested feature is disabled. |
