플레이그라운드
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 비디오
플레이그라운드
이 페이지에서 실제 Grok Imagine 동영상 작업을 제출한 다음, 반환된 작업 ID로 해당 작업을 폴링합니다.
POST
/
v1
/
task
/
submit
플레이그라운드
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
}
API 키와 프롬프트를 입력한 다음 전송합니다. 실제 API가 호출됩니다. 코드에서 호출하는 것과 동일한
엔드포인트이며, 동영상 모델에 액세스할 수 있는 유일한 방법입니다.
완료된 작업에는 MP4 하나가 포함된
파일은
이 페이지에서 전송하는 요청은 실제 요청이며 사용자의 키에 과금됩니다.
동영상은 초당 가격이 책정됩니다. 1초
480p 클립은 $0.05~$0.08이며,
15초 1080p 클립은 몇 달러가 청구됩니다. 짧은 길이로 시작합니다.매개변수
string
필수
실행할 모델입니다.
grok-imagine-video 또는 grok-imagine-video-1.5을 정확히 일치하도록 허용합니다.
기존 클립을 편집하거나 확장할 수 있는 모델은 grok-imagine-video뿐입니다.
1080p 및 프리셋 음성에 액세스할 수 있는 모델은 grok-imagine-video-1.5뿐입니다.object
필수
생성 매개변수입니다. 아래에 나열되지 않은 키는
invalid_params와 함께
거부됩니다.표시 input
표시 input
string
필수
생성할 항목 또는 편집 시 변경할 항목입니다.
string
기본값:"generate"
generate, edit 또는 extend입니다. edit 및 extend는 모두
input.video이 필요하며 grok-imagine-video에서만 작동합니다.integer
길이(초)로, 115초입니다. 10초로 제한하며, 제출 시점이 아니라 작업이 대기열에 추가된 후
적용됩니다. 소스 길이를 따르는
extend 모드에서는 업스트림 모델이
이를 2edit에서는 사용되지 않습니다.string
기본값:"480p"
grok-imagine-video-1.5에서만 480p, 720p 또는 1080p입니다. edit 모드에서는
거부되며, input.reference_images이 설정된 경우 720p로 제한됩니다.string
기본값:"16:9"
1:1 16:9 9:16 4:3 3:4 3:2 2:3 중 하나입니다. 이미지 모델과
달리 여기에는 auto가 없습니다.string[]
클립의 첫 번째 프레임으로 사용되는 이미지 정확히 1개입니다.
https URL
또는 base64 데이터 URI입니다. input.reference_images와 함께 사용할 수 없습니다.string
edit 및 extend의 소스 클립입니다. https URL 또는 base64 동영상
데이터 URI이며, 길이가 2초 이상이어야 합니다. 입력으로 초당 과금됩니다.string[]
모델이 스타일과 피사체를 참고할 이미지로 최대 3개까지 지정할 수 있습니다. 출력 길이는
720p로 제한됩니다. input.images와 함께 사용할 수 없습니다.string[]
grok-imagine-video-1.5에서만 사용할 수 있는 프리셋 음성으로, 최대 3개까지 지정할 수 있습니다. 값은
제출 시점에 확인되지 않으므로 잘못된 이름을 지정하면 나중에 작업이 실패합니다.boolean
기본값:"true"
무음 클립을 위해
false으로 설정합니다. 가격은 변경되지 않습니다.string
완료된 작업을 POST할
https URL입니다. 이를 사용하면 폴링을 건너뛸 수 있습니다. 동영상 생성에는
20~50초가 걸리므로 콜백을 연결해 두는 것이 유용합니다.반환되는 내용
제출하면 1초도 안 되어 즉시 반환됩니다. 이 응답에는 클립이 포함되지 않습니다 — 생성은 백그라운드에서 진행됩니다.| 필드 | 유형 | 설명 |
|---|---|---|
id | 문자열 | 작업 ID입니다. 다른 모든 작업에 이 값이 필요합니다. |
status | 문자열 | 새 작업에서의 queued입니다. |
created_at | 정수 | Unix 시간(초), UTC입니다. |
{
"id": "task_IIISyUlKs0fJDptkSCLbcJvXWZLpECKM",
"status": "queued",
"created_at": 1788189046
}
그런 다음 결과를 폴링합니다
이 플레이그라운드에서는 생성 호출만 다룹니다. 위 응답에서id을 가져온 다음
status이 completed 또는 failed에 도달할 때까지 작업을 확인합니다. 길이와 해상도에 따라
20~50초가 걸릴 수 있습니다.
curl https://api.widerouter.com/v1/task/$TASK_ID \
-H "Authorization: Bearer $WIDEROUTER_API_KEY"
outputs 배열이 있습니다.
{
"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으로 제공되며 인라인으로 재생됩니다. 재생 시간은 요청한 시간보다 약
0.04초 더 깁니다.
출력 URL에는 인증이 적용되지 않으며 작업 완료 후 24시간이 지나면 만료됩니다.
usage.cost_in_usd_ticks는 정가이며, 잔액은 해당 금액에 그룹 요율 배수를 곱한 만큼
변동됩니다. 자세한 내용은
가격을 참조하십시오.다음 단계
개요
모드, 지속 시간 및 해상도 등급, 참조 이미지, 음성 및 가격입니다.
비동기 작업 API
폴링 루프, 콜백 및 전체 오류 표입니다.