curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok_imagine_1_5",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_url": "https://your-cdn.com/reference.jpg",
"duration": 8,
"resolution": "480p",
"ratio": "auto"
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "grok_imagine_1_5",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_url": "https://your-cdn.com/reference.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',
prompt: 'The woman turns to the camera and smiles, cinematic',
image_url: 'https://your-cdn.com/reference.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',
'prompt' => 'The woman turns to the camera and smiles, cinematic',
'image_url' => 'https://your-cdn.com/reference.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\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_url\": \"https://your-cdn.com/reference.jpg\",\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\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_url\": \"https://your-cdn.com/reference.jpg\",\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\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_url\": \"https://your-cdn.com/reference.jpg\",\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",
"cost": 5.82
}
}Grok Imagine 1.5
Grok Imagine 1.5 text-to-video and image-to-video. image_url is optional: omit it for pure text-to-video, or pass a single reference image to animate it. For 2-7 reference images use grok_imagine_1_5_refs.
1080p videos take longer to finish than 480p or 720p.
Pricing — per second of generated video, in tokens (USD at $0.02/token). 1080p costs twice the 720p rate:
| resolution | tokens/s | USD/s |
|---|---|---|
| 480p | 2.5 | $0.05 |
| 720p | 4.7 | $0.094 |
| 1080p | 9.4 | $0.188 |
Example: an 8s 480p video costs 20 tokens (= 0.40).An8s720pvideocosts37.6tokens(=0.752). An 8s 1080p video costs 75.2 tokens (= $1.504).
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",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_url": "https://your-cdn.com/reference.jpg",
"duration": 8,
"resolution": "480p",
"ratio": "auto"
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "grok_imagine_1_5",
"prompt": "The woman turns to the camera and smiles, cinematic",
"image_url": "https://your-cdn.com/reference.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',
prompt: 'The woman turns to the camera and smiles, cinematic',
image_url: 'https://your-cdn.com/reference.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',
'prompt' => 'The woman turns to the camera and smiles, cinematic',
'image_url' => 'https://your-cdn.com/reference.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\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_url\": \"https://your-cdn.com/reference.jpg\",\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\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_url\": \"https://your-cdn.com/reference.jpg\",\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\",\n \"prompt\": \"The woman turns to the camera and smiles, cinematic\",\n \"image_url\": \"https://your-cdn.com/reference.jpg\",\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",
"cost": 5.82
}
}Headers
Body
Model name. Must be grok_imagine_1_5.
grok_imagine_1_5 Text prompt describing the video. Max 4096 characters.
4096Optional reference image URL. Omit it for pure text-to-video. Max 20MB; jpeg/png/webp. This endpoint takes a single image — for 2-7 reference images use grok_imagine_1_5_refs. (The legacy image_urls array is still accepted and still limited to one item.)
Video duration in seconds (1-15). Default 8.
1 <= x <= 15Output resolution. 1080p takes longer to finish.
480p, 720p, 1080p Aspect ratio. Effective for text-to-video; when a reference image is supplied the video follows the image's dimensions.
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"
