Playground
curl --request POST \
--url https://api.widerouter.com/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"input.prompt": "<string>",
"input.mode": "<string>",
"input.duration": 123,
"input.resolution": "<string>",
"input.aspect_ratio": "<string>",
"input.images": [
"<string>"
],
"input.video": "<string>",
"input.reference_images": [
"<string>"
],
"input.voice_ids": [
"<string>"
],
"input.generate_audio": true
},
"callback_url": "<string>"
}
'import requests
url = "https://api.widerouter.com/v1/task/submit"
payload = {
"model": "<string>",
"input": {
"input.prompt": "<string>",
"input.mode": "<string>",
"input.duration": 123,
"input.resolution": "<string>",
"input.aspect_ratio": "<string>",
"input.images": ["<string>"],
"input.video": "<string>",
"input.reference_images": ["<string>"],
"input.voice_ids": ["<string>"],
"input.generate_audio": True
},
"callback_url": "<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: {
'input.prompt': '<string>',
'input.mode': '<string>',
'input.duration': 123,
'input.resolution': '<string>',
'input.aspect_ratio': '<string>',
'input.images': ['<string>'],
'input.video': '<string>',
'input.reference_images': ['<string>'],
'input.voice_ids': ['<string>'],
'input.generate_audio': true
},
callback_url: '<string>'
})
};
fetch('https://api.widerouter.com/v1/task/submit', 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.widerouter.com/v1/task/submit",
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' => [
'input.prompt' => '<string>',
'input.mode' => '<string>',
'input.duration' => 123,
'input.resolution' => '<string>',
'input.aspect_ratio' => '<string>',
'input.images' => [
'<string>'
],
'input.video' => '<string>',
'input.reference_images' => [
'<string>'
],
'input.voice_ids' => [
'<string>'
],
'input.generate_audio' => true
],
'callback_url' => '<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://api.widerouter.com/v1/task/submit"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {\n \"input.prompt\": \"<string>\",\n \"input.mode\": \"<string>\",\n \"input.duration\": 123,\n \"input.resolution\": \"<string>\",\n \"input.aspect_ratio\": \"<string>\",\n \"input.images\": [\n \"<string>\"\n ],\n \"input.video\": \"<string>\",\n \"input.reference_images\": [\n \"<string>\"\n ],\n \"input.voice_ids\": [\n \"<string>\"\n ],\n \"input.generate_audio\": true\n },\n \"callback_url\": \"<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://api.widerouter.com/v1/task/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {\n \"input.prompt\": \"<string>\",\n \"input.mode\": \"<string>\",\n \"input.duration\": 123,\n \"input.resolution\": \"<string>\",\n \"input.aspect_ratio\": \"<string>\",\n \"input.images\": [\n \"<string>\"\n ],\n \"input.video\": \"<string>\",\n \"input.reference_images\": [\n \"<string>\"\n ],\n \"input.voice_ids\": [\n \"<string>\"\n ],\n \"input.generate_audio\": true\n },\n \"callback_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.widerouter.com/v1/task/submit")
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 \"input.prompt\": \"<string>\",\n \"input.mode\": \"<string>\",\n \"input.duration\": 123,\n \"input.resolution\": \"<string>\",\n \"input.aspect_ratio\": \"<string>\",\n \"input.images\": [\n \"<string>\"\n ],\n \"input.video\": \"<string>\",\n \"input.reference_images\": [\n \"<string>\"\n ],\n \"input.voice_ids\": [\n \"<string>\"\n ],\n \"input.generate_audio\": true\n },\n \"callback_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "task_IIISyUlKs0fJDptkSCLbcJvXWZLpECKM",
"status": "queued",
"created_at": 1788189046
}
Grok Imagine video
Playground
Submit a real Grok Imagine video task from this page, then poll it with the returned task id.
POST
/
v1
/
task
/
submit
Playground
curl --request POST \
--url https://api.widerouter.com/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"input.prompt": "<string>",
"input.mode": "<string>",
"input.duration": 123,
"input.resolution": "<string>",
"input.aspect_ratio": "<string>",
"input.images": [
"<string>"
],
"input.video": "<string>",
"input.reference_images": [
"<string>"
],
"input.voice_ids": [
"<string>"
],
"input.generate_audio": true
},
"callback_url": "<string>"
}
'import requests
url = "https://api.widerouter.com/v1/task/submit"
payload = {
"model": "<string>",
"input": {
"input.prompt": "<string>",
"input.mode": "<string>",
"input.duration": 123,
"input.resolution": "<string>",
"input.aspect_ratio": "<string>",
"input.images": ["<string>"],
"input.video": "<string>",
"input.reference_images": ["<string>"],
"input.voice_ids": ["<string>"],
"input.generate_audio": True
},
"callback_url": "<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: {
'input.prompt': '<string>',
'input.mode': '<string>',
'input.duration': 123,
'input.resolution': '<string>',
'input.aspect_ratio': '<string>',
'input.images': ['<string>'],
'input.video': '<string>',
'input.reference_images': ['<string>'],
'input.voice_ids': ['<string>'],
'input.generate_audio': true
},
callback_url: '<string>'
})
};
fetch('https://api.widerouter.com/v1/task/submit', 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.widerouter.com/v1/task/submit",
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' => [
'input.prompt' => '<string>',
'input.mode' => '<string>',
'input.duration' => 123,
'input.resolution' => '<string>',
'input.aspect_ratio' => '<string>',
'input.images' => [
'<string>'
],
'input.video' => '<string>',
'input.reference_images' => [
'<string>'
],
'input.voice_ids' => [
'<string>'
],
'input.generate_audio' => true
],
'callback_url' => '<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://api.widerouter.com/v1/task/submit"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {\n \"input.prompt\": \"<string>\",\n \"input.mode\": \"<string>\",\n \"input.duration\": 123,\n \"input.resolution\": \"<string>\",\n \"input.aspect_ratio\": \"<string>\",\n \"input.images\": [\n \"<string>\"\n ],\n \"input.video\": \"<string>\",\n \"input.reference_images\": [\n \"<string>\"\n ],\n \"input.voice_ids\": [\n \"<string>\"\n ],\n \"input.generate_audio\": true\n },\n \"callback_url\": \"<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://api.widerouter.com/v1/task/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {\n \"input.prompt\": \"<string>\",\n \"input.mode\": \"<string>\",\n \"input.duration\": 123,\n \"input.resolution\": \"<string>\",\n \"input.aspect_ratio\": \"<string>\",\n \"input.images\": [\n \"<string>\"\n ],\n \"input.video\": \"<string>\",\n \"input.reference_images\": [\n \"<string>\"\n ],\n \"input.voice_ids\": [\n \"<string>\"\n ],\n \"input.generate_audio\": true\n },\n \"callback_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.widerouter.com/v1/task/submit")
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 \"input.prompt\": \"<string>\",\n \"input.mode\": \"<string>\",\n \"input.duration\": 123,\n \"input.resolution\": \"<string>\",\n \"input.aspect_ratio\": \"<string>\",\n \"input.images\": [\n \"<string>\"\n ],\n \"input.video\": \"<string>\",\n \"input.reference_images\": [\n \"<string>\"\n ],\n \"input.voice_ids\": [\n \"<string>\"\n ],\n \"input.generate_audio\": true\n },\n \"callback_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "task_IIISyUlKs0fJDptkSCLbcJvXWZLpECKM",
"status": "queued",
"created_at": 1788189046
}
Fill in your API key and a prompt, then send. This hits the live API — the same
endpoint your code would call, and the only way to reach the video models.
A finished task carries an
The file is served as
Requests sent from this page are real and are billed to your key.
Video is priced per second: a one-second
480p clip costs $0.05 to $0.08,
and a fifteen-second 1080p clip costs several dollars. Start short.Parameters
string
required
Which model to run. Accepts
grok-imagine-video or grok-imagine-video-1.5,
matched exactly. Only grok-imagine-video can edit or extend an existing clip;
only grok-imagine-video-1.5 reaches 1080p and preset voices.object
required
The generation parameters. Any key not listed below is rejected with
invalid_params.Show input
Show input
string
required
What to generate, or what to change when editing.
string
default:"generate"
generate, edit or extend. Both edit and extend need
input.video and only work on grok-imagine-video.integer
Length in seconds, 1 to 15. In
extend mode the upstream model narrows
this to 2 to 10, which is enforced after the task is queued rather than at
submit time. Not used by edit, which follows the source length.string
default:"480p"
480p, 720p, or 1080p on grok-imagine-video-1.5 only. Rejected in
edit mode, and capped at 720p when input.reference_images is set.string
default:"16:9"
One of
1:1 16:9 9:16 4:3 3:4 3:2 2:3. There is no auto
here, unlike the image models.string[]
Exactly one image, used as the first frame of the clip. An
https URL
or a base64 data URI. Cannot be combined with input.reference_images.string
The source clip for
edit and extend. An https URL or a base64 video
data URI, and at least 2 seconds long. Charged per second as an input.string[]
Up to 3 images the model draws style and subject from. Caps the output at
720p. Cannot be combined with input.images.string[]
Up to 3 preset voices,
grok-imagine-video-1.5 only. The value is not
checked at submit time, so a wrong name fails the task later.boolean
default:"true"
Set
false for a silent clip. Does not change the price.string
An
https URL to POST the finished task to, so you can skip polling. Given
that video takes 20 to 50 seconds, a callback is worth wiring up.What comes back
Submitting returns immediately, in well under a second. The clip is not in this response — generation happens in the background.| Field | Type | Notes |
|---|---|---|
id | string | The task id. Everything else needs it. |
status | string | queued on a fresh task. |
created_at | integer | Unix seconds, UTC. |
{
"id": "task_IIISyUlKs0fJDptkSCLbcJvXWZLpECKM",
"status": "queued",
"created_at": 1788189046
}
Then poll for the result
This playground covers the create call only. Take theid from the response
above and read the task until status reaches completed or failed — expect
20 to 50 seconds depending on length and resolution.
curl https://api.widerouter.com/v1/task/$TASK_ID \
-H "Authorization: Bearer $WIDEROUTER_API_KEY"
outputs array holding one MP4:
{
"id": "task_IIISyUlKs0fJDptkSCLbcJvXWZLpECKM",
"model": "grok-imagine-video",
"status": "completed",
"created_at": 1788189046,
"completed_at": 1788189065,
"expires_at": 1788275465,
"outputs": ["https://r2cdn.agisuitepro.com/o/2026/08/31/task_IIISyUlKs0fJDptkSCLbcJvXWZLpECKM_0.mp4"],
"counts": { "requested": 1, "succeeded": 1, "failed": 0 },
"usage": { "cost_in_usd_ticks": 500000000 }
}
video/mp4 and plays inline. Its duration runs about
0.04 seconds longer than you asked for.
Output URLs are unauthenticated and expire 24 hours after the task finishes.
usage.cost_in_usd_ticks is the list price; your balance moves by that
figure times your group multiplier — see
pricing.Next steps
Overview
Modes, duration and resolution tiers, reference images, voices and pricing.
Async task API
The polling loop, callbacks and the full error table.