创建视频
curl --request POST \
--url https://octopusx.ai/v1/video/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"images": [
"<string>"
],
"aspect_ratio": "<string>",
"size": "<string>",
"duration": 123
}
'import requests
url = "https://octopusx.ai/v1/video/create"
payload = {
"model": "<string>",
"prompt": "<string>",
"images": ["<string>"],
"aspect_ratio": "<string>",
"size": "<string>",
"duration": 123
}
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>',
images: ['<string>'],
aspect_ratio: '<string>',
size: '<string>',
duration: 123
})
};
fetch('https://octopusx.ai/v1/video/create', 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/create",
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>',
'images' => [
'<string>'
],
'aspect_ratio' => '<string>',
'size' => '<string>',
'duration' => 123
]),
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/create"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"aspect_ratio\": \"<string>\",\n \"size\": \"<string>\",\n \"duration\": 123\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/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"aspect_ratio\": \"<string>\",\n \"size\": \"<string>\",\n \"duration\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/video/create")
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 \"images\": [\n \"<string>\"\n ],\n \"aspect_ratio\": \"<string>\",\n \"size\": \"<string>\",\n \"duration\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
"status": "processing",
"status_update_time": 1762780400,
"task_id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"created_at": "2025-11-08T23:07:57.510141923+08:00"
}
统一视频
创建视频
使用 POST /v1/video/create 通过统一视频格式提交 Grok 异步生成任务。
POST
https://octopusx.ai
/
v1
/
video
/
create
创建视频
curl --request POST \
--url https://octopusx.ai/v1/video/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"images": [
"<string>"
],
"aspect_ratio": "<string>",
"size": "<string>",
"duration": 123
}
'import requests
url = "https://octopusx.ai/v1/video/create"
payload = {
"model": "<string>",
"prompt": "<string>",
"images": ["<string>"],
"aspect_ratio": "<string>",
"size": "<string>",
"duration": 123
}
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>',
images: ['<string>'],
aspect_ratio: '<string>',
size: '<string>',
duration: 123
})
};
fetch('https://octopusx.ai/v1/video/create', 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/create",
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>',
'images' => [
'<string>'
],
'aspect_ratio' => '<string>',
'size' => '<string>',
'duration' => 123
]),
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/create"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"aspect_ratio\": \"<string>\",\n \"size\": \"<string>\",\n \"duration\": 123\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/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"aspect_ratio\": \"<string>\",\n \"size\": \"<string>\",\n \"duration\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/video/create")
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 \"images\": [\n \"<string>\"\n ],\n \"aspect_ratio\": \"<string>\",\n \"size\": \"<string>\",\n \"duration\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
"status": "processing",
"status_update_time": 1762780400,
"task_id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"created_at": "2025-11-08T23:07:57.510141923+08:00"
}
创建视频
Grok 统一视频入口使用POST /v1/video/create,请求体为 JSON。与 OpenAI 格式的 Grok 视频生成 不同,本接口使用 images、aspect_ratio、size 等字段,并支持在 prompt 中通过 @img1、@img2 引用多图。
- 路由入口是
POST /v1/video/create。 - 参考图通过
images数组传入 URL 或 base64;文生视频可传[]。 - 常见模型为
grok-video-3,以当前渠道实际可用模型为准。 - 提交成功后返回
id或task_id与status,后续用 查询任务 轮询结果。
方法与路径
POST /v1/video/create
请求示例
# 文生视频 / 首尾帧(images 为空或按场景传图)
curl -X POST https://octopusx.ai/v1/video/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"model": "grok-video-3",
"prompt": "cat fish --mode=custom",
"images": [],
"aspect_ratio": "3:2",
"size": "1080P",
"duration": 10
}'
# 多图参考(prompt 中用 @img1、@img2 引用 images 顺序)
curl -X POST https://octopusx.ai/v1/video/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-video-3",
"prompt": "@img1 一只猫拿着刀追 @img2",
"images": [
"data:image/png;base64,BASE64_IMAGE_1",
"data:image/png;base64,BASE64_IMAGE_2"
],
"aspect_ratio": "3:2",
"size": "1080P",
"duration": 6
}'
import requests
resp = requests.post(
"https://octopusx.ai/v1/video/create",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"model": "grok-video-3",
"prompt": "cat fish --mode=custom",
"images": [],
"aspect_ratio": "3:2",
"size": "1080P",
"duration": 10,
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://octopusx.ai/v1/video/create", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
model: "grok-video-3",
prompt: "cat fish --mode=custom",
images: [],
aspect_ratio: "3:2",
size: "1080P",
duration: 10,
}),
});
console.log(await response.json());
响应示例
{
"id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
"status": "processing",
"status_update_time": 1762780400,
"task_id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"created_at": "2025-11-08T23:07:57.510141923+08:00"
}
id 或 task_id 作为后续查询凭据。
认证
Authorization: Bearer YOUR_API_KEY
Body
模型名称,例如
grok-video-3。提示词。多图参考时可在文案中使用
@img1、@img2 等占位符,对应 images 数组下标顺序。参考图列表,元素为 URL 或 base64 data URI。文生视频可传
[];首尾帧一般按顺序传 2 张;多图参考最多支持 6 张。视频比例。可选
16:9、9:16、2:3、3:2、1:1。分辨率规格,传
720P 或 1080P。视频时长(秒)。默认
10,支持 6、10、15。Response
任务 ID,查询时作为
id 参数;部分响应可能仅返回 task_id。上游任务 ID,与
id 可能并存,以实际响应为准。任务状态,常见值包括
processing、completed、failed。状态最近更新时间(Unix 时间戳)。
创建时间,部分响应为 RFC3339 字符串。
相关接口
⌘I