curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok_imagine_1_5_refs",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_urls": [
"https://your-cdn.com/reference-1.jpg",
"https://your-cdn.com/reference-2.jpg"
],
"duration": 8,
"resolution": "480p",
"ratio": "auto"
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "grok_imagine_1_5_refs",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_urls": ["https://your-cdn.com/reference-1.jpg", "https://your-cdn.com/reference-2.jpg"],
"duration": 8,
"resolution": "480p",
"ratio": "auto"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'grok_imagine_1_5_refs',
prompt: 'The woman turns to the camera and smiles, cinematic',
image_urls: ['https://your-cdn.com/reference-1.jpg', 'https://your-cdn.com/reference-2.jpg'],
duration: 8,
resolution: '480p',
ratio: 'auto'
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', 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.goenhance.ai/api/v1/videos/generations",
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' => 'grok_imagine_1_5_refs',
'prompt' => 'The woman turns to the camera and smiles, cinematic',
'image_urls' => [
'https://your-cdn.com/reference-1.jpg',
'https://your-cdn.com/reference-2.jpg'
],
'duration' => 8,
'resolution' => '480p',
'ratio' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"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.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"grok_imagine_1_5_refs\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_urls\": [\n \"https://your-cdn.com/reference-1.jpg\",\n \"https://your-cdn.com/reference-2.jpg\"\n ],\n \"duration\": 8,\n \"resolution\": \"480p\",\n \"ratio\": \"auto\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"grok_imagine_1_5_refs\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_urls\": [\n \"https://your-cdn.com/reference-1.jpg\",\n \"https://your-cdn.com/reference-2.jpg\"\n ],\n \"duration\": 8,\n \"resolution\": \"480p\",\n \"ratio\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"grok_imagine_1_5_refs\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_urls\": [\n \"https://your-cdn.com/reference-1.jpg\",\n \"https://your-cdn.com/reference-2.jpg\"\n ],\n \"duration\": 8,\n \"resolution\": \"480p\",\n \"ratio\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5"
}
}Grok Imagine 1.5 Refs
Grok Imagine 1.5 with multiple reference images (1-7). Use this endpoint when you have more than one reference image; for a single image use grok_imagine_1_5, which additionally supports 1080p.
image_urls is required — this model animates reference images and does not support pure text-to-video.
Pricing — per second of generated video, in tokens (USD at $0.02/token). Same rates as grok_imagine_1_5; the number of reference images does not affect the price:
| resolution | tokens/s | USD/s |
|---|---|---|
| 480p | 2.5 | $0.05 |
| 720p | 4.7 | $0.094 |
Example: an 8s 480p video costs 20 tokens (= 0.40).An8s720pvideocosts37.6tokens(=0.752).
Returns an img_uuid; poll GET /api/v1/jobs/detail (or use custom_callback_url) to get the generated video.
curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok_imagine_1_5_refs",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_urls": [
"https://your-cdn.com/reference-1.jpg",
"https://your-cdn.com/reference-2.jpg"
],
"duration": 8,
"resolution": "480p",
"ratio": "auto"
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "grok_imagine_1_5_refs",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_urls": ["https://your-cdn.com/reference-1.jpg", "https://your-cdn.com/reference-2.jpg"],
"duration": 8,
"resolution": "480p",
"ratio": "auto"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'grok_imagine_1_5_refs',
prompt: 'The woman turns to the camera and smiles, cinematic',
image_urls: ['https://your-cdn.com/reference-1.jpg', 'https://your-cdn.com/reference-2.jpg'],
duration: 8,
resolution: '480p',
ratio: 'auto'
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', 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.goenhance.ai/api/v1/videos/generations",
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' => 'grok_imagine_1_5_refs',
'prompt' => 'The woman turns to the camera and smiles, cinematic',
'image_urls' => [
'https://your-cdn.com/reference-1.jpg',
'https://your-cdn.com/reference-2.jpg'
],
'duration' => 8,
'resolution' => '480p',
'ratio' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"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.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"grok_imagine_1_5_refs\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_urls\": [\n \"https://your-cdn.com/reference-1.jpg\",\n \"https://your-cdn.com/reference-2.jpg\"\n ],\n \"duration\": 8,\n \"resolution\": \"480p\",\n \"ratio\": \"auto\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"grok_imagine_1_5_refs\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_urls\": [\n \"https://your-cdn.com/reference-1.jpg\",\n \"https://your-cdn.com/reference-2.jpg\"\n ],\n \"duration\": 8,\n \"resolution\": \"480p\",\n \"ratio\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"grok_imagine_1_5_refs\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_urls\": [\n \"https://your-cdn.com/reference-1.jpg\",\n \"https://your-cdn.com/reference-2.jpg\"\n ],\n \"duration\": 8,\n \"resolution\": \"480p\",\n \"ratio\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5"
}
}Headers
Body
Model name. Must be grok_imagine_1_5_refs.
grok_imagine_1_5_refs Text prompt describing the video. Max 4096 characters.
4096Reference image URLs (required, 1-7 images). Max 20MB each; jpeg/png/webp.
1 - 7 elementsVideo duration in seconds (1-15). Default 8.
1 <= x <= 15Output resolution. 1080p is not available on this endpoint — upstream accepts 1080p only with a single reference image, so use grok_imagine_1_5 for it.
480p, 720p Aspect ratio. auto follows the reference image.
auto, 1:1, 16:9, 9:16, 3:2, 2:3 Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.
"https://your-server.com/goenhance/callback"
