视频Extend
curl --request POST \
--url https://octopusx.ai/v1/video/extend \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"task_id": "<string>",
"images": [
"<string>"
],
"size": "<string>",
"aspect_ratio": "<string>",
"start_time": 123,
"upscale": true
}
'import requests
url = "https://octopusx.ai/v1/video/extend"
payload = {
"model": "<string>",
"prompt": "<string>",
"task_id": "<string>",
"images": ["<string>"],
"size": "<string>",
"aspect_ratio": "<string>",
"start_time": 123,
"upscale": True
}
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>',
prompt: '<string>',
task_id: '<string>',
images: ['<string>'],
size: '<string>',
aspect_ratio: '<string>',
start_time: 123,
upscale: true
})
};
fetch('https://octopusx.ai/v1/video/extend', 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://octopusx.ai/v1/video/extend",
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>',
'prompt' => '<string>',
'task_id' => '<string>',
'images' => [
'<string>'
],
'size' => '<string>',
'aspect_ratio' => '<string>',
'start_time' => 123,
'upscale' => true
]),
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://octopusx.ai/v1/video/extend"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"task_id\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"start_time\": 123,\n \"upscale\": true\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://octopusx.ai/v1/video/extend")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"task_id\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"start_time\": 123,\n \"upscale\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/video/extend")
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 \"prompt\": \"<string>\",\n \"task_id\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"start_time\": 123,\n \"upscale\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
"status": "processing",
"status_update_time": 1762685256
}
统一视频
视频Extend
使用 POST /v1/video/extend 通过统一视频格式对已有 Grok 任务做片段延展。
POST
https://octopusx.ai
/
v1
/
video
/
extend
视频Extend
curl --request POST \
--url https://octopusx.ai/v1/video/extend \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"task_id": "<string>",
"images": [
"<string>"
],
"size": "<string>",
"aspect_ratio": "<string>",
"start_time": 123,
"upscale": true
}
'import requests
url = "https://octopusx.ai/v1/video/extend"
payload = {
"model": "<string>",
"prompt": "<string>",
"task_id": "<string>",
"images": ["<string>"],
"size": "<string>",
"aspect_ratio": "<string>",
"start_time": 123,
"upscale": True
}
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>',
prompt: '<string>',
task_id: '<string>',
images: ['<string>'],
size: '<string>',
aspect_ratio: '<string>',
start_time: 123,
upscale: true
})
};
fetch('https://octopusx.ai/v1/video/extend', 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://octopusx.ai/v1/video/extend",
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>',
'prompt' => '<string>',
'task_id' => '<string>',
'images' => [
'<string>'
],
'size' => '<string>',
'aspect_ratio' => '<string>',
'start_time' => 123,
'upscale' => true
]),
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://octopusx.ai/v1/video/extend"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"task_id\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"start_time\": 123,\n \"upscale\": true\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://octopusx.ai/v1/video/extend")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"task_id\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"start_time\": 123,\n \"upscale\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/video/extend")
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 \"prompt\": \"<string>\",\n \"task_id\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"start_time\": 123,\n \"upscale\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
"status": "processing",
"status_update_time": 1762685256
}
视频Extend
Grok 统一视频 extend 入口为POST /v1/video/extend。与 OpenAI 格式的视频Extend 不同,原任务 ID 通过 Body 的 task_id 传入。
- 路由入口是
POST /v1/video/extend。 - 必填
model、prompt、task_id。 - 可通过
start_time指定从原视频哪一秒开始延展。
方法与路径
POST /v1/video/extend
请求示例
curl -X POST https://octopusx.ai/v1/video/extend \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"model": "grok-video-3",
"prompt": "play with another white cat",
"task_id": "grok:2d8ef725-c4a9-46e0-b133-eca6c297e830",
"start_time": 4,
"aspect_ratio": "3:2",
"size": "1080P",
"upscale": true
}'
import requests
resp = requests.post(
"https://octopusx.ai/v1/video/extend",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"model": "grok-video-3",
"prompt": "play with another white cat",
"task_id": "grok:2d8ef725-c4a9-46e0-b133-eca6c297e830",
"start_time": 4,
"aspect_ratio": "3:2",
"size": "1080P",
"upscale": True,
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://octopusx.ai/v1/video/extend", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
model: "grok-video-3",
prompt: "play with another white cat",
task_id: "grok:2d8ef725-c4a9-46e0-b133-eca6c297e830",
start_time: 4,
aspect_ratio: "3:2",
size: "1080P",
upscale: true,
}),
});
console.log(await response.json());
响应示例
{
"id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
"status": "processing",
"status_update_time": 1762685256
}
认证
Authorization: Bearer YOUR_API_KEY
Body
模型名称,例如
grok-video-3。延展片段的提示词。
原始视频任务 ID。
参考图链接列表,按需补充视觉约束。
分辨率规格,传
720P 或 1080P。视频比例,例如
3:2。从原视频的哪一秒开始延展。
是否对输出做高清增强。
Response
新 extend 任务 ID。
任务状态,常见值包括
processing、completed、failed。状态最近更新时间(Unix 时间戳)。
相关接口
⌘I