视频生成接口
curl --request POST \
--url https://geekai.co/api/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "cogvideox-flash",
"prompt": "彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦",
"negative_prompt": "<string>",
"action": "auto",
"image": "<string>",
"image_tail": "<string>",
"images": [
"<string>"
],
"video": "<string>",
"audio": "<string>",
"with_audio": false,
"size": "720x720",
"resolution": "720p",
"aspect_ratio": "16:9",
"quality": "speed",
"duration": 5,
"draft": false,
"draft_task_id": "<string>",
"fps": 30,
"watermark": false,
"output_format": "mp4",
"async": true,
"extra_body": {
"draft": false,
"return_last_frame": false,
"movement_amplitude": "<string>",
"camera_strength": "<string>",
"image_list": [
{
"image_url": "<string>",
"type": "<string>"
}
],
"video_list": [
{
"video_url": "<string>",
"refer_type": "<string>",
"keep_original_sound": "<string>"
}
],
"element_list": [
{
"element_id": 123
}
],
"voice_list": [
{
"voice_id": "<string>"
}
],
"multi_shot": true,
"shot_type": "<string>",
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"camera_control": {
"type": "<string>",
"config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
}
},
"static_mask": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"real_person_mode": true,
"file": "<string>",
"link": "<string>",
"tools": [
{
"type": "<string>"
}
]
},
"retries": 0
}
'import requests
url = "https://geekai.co/api/v1/videos/generations"
payload = {
"model": "cogvideox-flash",
"prompt": "彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦",
"negative_prompt": "<string>",
"action": "auto",
"image": "<string>",
"image_tail": "<string>",
"images": ["<string>"],
"video": "<string>",
"audio": "<string>",
"with_audio": False,
"size": "720x720",
"resolution": "720p",
"aspect_ratio": "16:9",
"quality": "speed",
"duration": 5,
"draft": False,
"draft_task_id": "<string>",
"fps": 30,
"watermark": False,
"output_format": "mp4",
"async": True,
"extra_body": {
"draft": False,
"return_last_frame": False,
"movement_amplitude": "<string>",
"camera_strength": "<string>",
"image_list": [
{
"image_url": "<string>",
"type": "<string>"
}
],
"video_list": [
{
"video_url": "<string>",
"refer_type": "<string>",
"keep_original_sound": "<string>"
}
],
"element_list": [{ "element_id": 123 }],
"voice_list": [{ "voice_id": "<string>" }],
"multi_shot": True,
"shot_type": "<string>",
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"camera_control": {
"type": "<string>",
"config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
}
},
"static_mask": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"real_person_mode": True,
"file": "<string>",
"link": "<string>",
"tools": [{ "type": "<string>" }]
},
"retries": 0
}
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: 'cogvideox-flash',
prompt: '彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦',
negative_prompt: '<string>',
action: 'auto',
image: '<string>',
image_tail: '<string>',
images: ['<string>'],
video: '<string>',
audio: '<string>',
with_audio: false,
size: '720x720',
resolution: '720p',
aspect_ratio: '16:9',
quality: 'speed',
duration: 5,
draft: false,
draft_task_id: '<string>',
fps: 30,
watermark: false,
output_format: 'mp4',
async: true,
extra_body: {
draft: false,
return_last_frame: false,
movement_amplitude: '<string>',
camera_strength: '<string>',
image_list: [{image_url: '<string>', type: '<string>'}],
video_list: [
{video_url: '<string>', refer_type: '<string>', keep_original_sound: '<string>'}
],
element_list: [{element_id: 123}],
voice_list: [{voice_id: '<string>'}],
multi_shot: true,
shot_type: '<string>',
multi_prompt: [{index: 123, prompt: '<string>', duration: '<string>'}],
camera_control: {
type: '<string>',
config: {horizontal: 123, vertical: 123, pan: 123, tilt: 123, roll: 123, zoom: 123}
},
static_mask: '<string>',
dynamic_masks: [{mask: '<string>', trajectories: [{x: 123, y: 123}]}],
real_person_mode: true,
file: '<string>',
link: '<string>',
tools: [{type: '<string>'}]
},
retries: 0
})
};
fetch('https://geekai.co/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://geekai.co/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' => 'cogvideox-flash',
'prompt' => '彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦',
'negative_prompt' => '<string>',
'action' => 'auto',
'image' => '<string>',
'image_tail' => '<string>',
'images' => [
'<string>'
],
'video' => '<string>',
'audio' => '<string>',
'with_audio' => false,
'size' => '720x720',
'resolution' => '720p',
'aspect_ratio' => '16:9',
'quality' => 'speed',
'duration' => 5,
'draft' => false,
'draft_task_id' => '<string>',
'fps' => 30,
'watermark' => false,
'output_format' => 'mp4',
'async' => true,
'extra_body' => [
'draft' => false,
'return_last_frame' => false,
'movement_amplitude' => '<string>',
'camera_strength' => '<string>',
'image_list' => [
[
'image_url' => '<string>',
'type' => '<string>'
]
],
'video_list' => [
[
'video_url' => '<string>',
'refer_type' => '<string>',
'keep_original_sound' => '<string>'
]
],
'element_list' => [
[
'element_id' => 123
]
],
'voice_list' => [
[
'voice_id' => '<string>'
]
],
'multi_shot' => true,
'shot_type' => '<string>',
'multi_prompt' => [
[
'index' => 123,
'prompt' => '<string>',
'duration' => '<string>'
]
],
'camera_control' => [
'type' => '<string>',
'config' => [
'horizontal' => 123,
'vertical' => 123,
'pan' => 123,
'tilt' => 123,
'roll' => 123,
'zoom' => 123
]
],
'static_mask' => '<string>',
'dynamic_masks' => [
[
'mask' => '<string>',
'trajectories' => [
[
'x' => 123,
'y' => 123
]
]
]
],
'real_person_mode' => true,
'file' => '<string>',
'link' => '<string>',
'tools' => [
[
'type' => '<string>'
]
]
],
'retries' => 0
]),
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://geekai.co/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"cogvideox-flash\",\n \"prompt\": \"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦\",\n \"negative_prompt\": \"<string>\",\n \"action\": \"auto\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"with_audio\": false,\n \"size\": \"720x720\",\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"quality\": \"speed\",\n \"duration\": 5,\n \"draft\": false,\n \"draft_task_id\": \"<string>\",\n \"fps\": 30,\n \"watermark\": false,\n \"output_format\": \"mp4\",\n \"async\": true,\n \"extra_body\": {\n \"draft\": false,\n \"return_last_frame\": false,\n \"movement_amplitude\": \"<string>\",\n \"camera_strength\": \"<string>\",\n \"image_list\": [\n {\n \"image_url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"video_list\": [\n {\n \"video_url\": \"<string>\",\n \"refer_type\": \"<string>\",\n \"keep_original_sound\": \"<string>\"\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"shot_type\": \"<string>\",\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"camera_control\": {\n \"type\": \"<string>\",\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"static_mask\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"real_person_mode\": true,\n \"file\": \"<string>\",\n \"link\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"<string>\"\n }\n ]\n },\n \"retries\": 0\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://geekai.co/api/v1/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"cogvideox-flash\",\n \"prompt\": \"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦\",\n \"negative_prompt\": \"<string>\",\n \"action\": \"auto\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"with_audio\": false,\n \"size\": \"720x720\",\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"quality\": \"speed\",\n \"duration\": 5,\n \"draft\": false,\n \"draft_task_id\": \"<string>\",\n \"fps\": 30,\n \"watermark\": false,\n \"output_format\": \"mp4\",\n \"async\": true,\n \"extra_body\": {\n \"draft\": false,\n \"return_last_frame\": false,\n \"movement_amplitude\": \"<string>\",\n \"camera_strength\": \"<string>\",\n \"image_list\": [\n {\n \"image_url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"video_list\": [\n {\n \"video_url\": \"<string>\",\n \"refer_type\": \"<string>\",\n \"keep_original_sound\": \"<string>\"\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"shot_type\": \"<string>\",\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"camera_control\": {\n \"type\": \"<string>\",\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"static_mask\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"real_person_mode\": true,\n \"file\": \"<string>\",\n \"link\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"<string>\"\n }\n ]\n },\n \"retries\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/videos/generations")
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\": \"cogvideox-flash\",\n \"prompt\": \"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦\",\n \"negative_prompt\": \"<string>\",\n \"action\": \"auto\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"with_audio\": false,\n \"size\": \"720x720\",\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"quality\": \"speed\",\n \"duration\": 5,\n \"draft\": false,\n \"draft_task_id\": \"<string>\",\n \"fps\": 30,\n \"watermark\": false,\n \"output_format\": \"mp4\",\n \"async\": true,\n \"extra_body\": {\n \"draft\": false,\n \"return_last_frame\": false,\n \"movement_amplitude\": \"<string>\",\n \"camera_strength\": \"<string>\",\n \"image_list\": [\n {\n \"image_url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"video_list\": [\n {\n \"video_url\": \"<string>\",\n \"refer_type\": \"<string>\",\n \"keep_original_sound\": \"<string>\"\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"shot_type\": \"<string>\",\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"camera_control\": {\n \"type\": \"<string>\",\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"static_mask\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"real_person_mode\": true,\n \"file\": \"<string>\",\n \"link\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"<string>\"\n }\n ]\n },\n \"retries\": 0\n}"
response = http.request(request)
puts response.read_body{
"model": "cogvideox-flash",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_status": "running",
"video_result": {
"id": "<string>",
"url": "<string>",
"cover_image_url": "<string>",
"duration": 123,
"revised_prompt": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": "validation_error",
"message": "参数验证失败",
"details": {
"field": "错误描述"
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}Video Models
Create a video task
POST
/
videos
/
generations
视频生成接口
curl --request POST \
--url https://geekai.co/api/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "cogvideox-flash",
"prompt": "彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦",
"negative_prompt": "<string>",
"action": "auto",
"image": "<string>",
"image_tail": "<string>",
"images": [
"<string>"
],
"video": "<string>",
"audio": "<string>",
"with_audio": false,
"size": "720x720",
"resolution": "720p",
"aspect_ratio": "16:9",
"quality": "speed",
"duration": 5,
"draft": false,
"draft_task_id": "<string>",
"fps": 30,
"watermark": false,
"output_format": "mp4",
"async": true,
"extra_body": {
"draft": false,
"return_last_frame": false,
"movement_amplitude": "<string>",
"camera_strength": "<string>",
"image_list": [
{
"image_url": "<string>",
"type": "<string>"
}
],
"video_list": [
{
"video_url": "<string>",
"refer_type": "<string>",
"keep_original_sound": "<string>"
}
],
"element_list": [
{
"element_id": 123
}
],
"voice_list": [
{
"voice_id": "<string>"
}
],
"multi_shot": true,
"shot_type": "<string>",
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"camera_control": {
"type": "<string>",
"config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
}
},
"static_mask": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"real_person_mode": true,
"file": "<string>",
"link": "<string>",
"tools": [
{
"type": "<string>"
}
]
},
"retries": 0
}
'import requests
url = "https://geekai.co/api/v1/videos/generations"
payload = {
"model": "cogvideox-flash",
"prompt": "彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦",
"negative_prompt": "<string>",
"action": "auto",
"image": "<string>",
"image_tail": "<string>",
"images": ["<string>"],
"video": "<string>",
"audio": "<string>",
"with_audio": False,
"size": "720x720",
"resolution": "720p",
"aspect_ratio": "16:9",
"quality": "speed",
"duration": 5,
"draft": False,
"draft_task_id": "<string>",
"fps": 30,
"watermark": False,
"output_format": "mp4",
"async": True,
"extra_body": {
"draft": False,
"return_last_frame": False,
"movement_amplitude": "<string>",
"camera_strength": "<string>",
"image_list": [
{
"image_url": "<string>",
"type": "<string>"
}
],
"video_list": [
{
"video_url": "<string>",
"refer_type": "<string>",
"keep_original_sound": "<string>"
}
],
"element_list": [{ "element_id": 123 }],
"voice_list": [{ "voice_id": "<string>" }],
"multi_shot": True,
"shot_type": "<string>",
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"camera_control": {
"type": "<string>",
"config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
}
},
"static_mask": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"real_person_mode": True,
"file": "<string>",
"link": "<string>",
"tools": [{ "type": "<string>" }]
},
"retries": 0
}
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: 'cogvideox-flash',
prompt: '彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦',
negative_prompt: '<string>',
action: 'auto',
image: '<string>',
image_tail: '<string>',
images: ['<string>'],
video: '<string>',
audio: '<string>',
with_audio: false,
size: '720x720',
resolution: '720p',
aspect_ratio: '16:9',
quality: 'speed',
duration: 5,
draft: false,
draft_task_id: '<string>',
fps: 30,
watermark: false,
output_format: 'mp4',
async: true,
extra_body: {
draft: false,
return_last_frame: false,
movement_amplitude: '<string>',
camera_strength: '<string>',
image_list: [{image_url: '<string>', type: '<string>'}],
video_list: [
{video_url: '<string>', refer_type: '<string>', keep_original_sound: '<string>'}
],
element_list: [{element_id: 123}],
voice_list: [{voice_id: '<string>'}],
multi_shot: true,
shot_type: '<string>',
multi_prompt: [{index: 123, prompt: '<string>', duration: '<string>'}],
camera_control: {
type: '<string>',
config: {horizontal: 123, vertical: 123, pan: 123, tilt: 123, roll: 123, zoom: 123}
},
static_mask: '<string>',
dynamic_masks: [{mask: '<string>', trajectories: [{x: 123, y: 123}]}],
real_person_mode: true,
file: '<string>',
link: '<string>',
tools: [{type: '<string>'}]
},
retries: 0
})
};
fetch('https://geekai.co/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://geekai.co/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' => 'cogvideox-flash',
'prompt' => '彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦',
'negative_prompt' => '<string>',
'action' => 'auto',
'image' => '<string>',
'image_tail' => '<string>',
'images' => [
'<string>'
],
'video' => '<string>',
'audio' => '<string>',
'with_audio' => false,
'size' => '720x720',
'resolution' => '720p',
'aspect_ratio' => '16:9',
'quality' => 'speed',
'duration' => 5,
'draft' => false,
'draft_task_id' => '<string>',
'fps' => 30,
'watermark' => false,
'output_format' => 'mp4',
'async' => true,
'extra_body' => [
'draft' => false,
'return_last_frame' => false,
'movement_amplitude' => '<string>',
'camera_strength' => '<string>',
'image_list' => [
[
'image_url' => '<string>',
'type' => '<string>'
]
],
'video_list' => [
[
'video_url' => '<string>',
'refer_type' => '<string>',
'keep_original_sound' => '<string>'
]
],
'element_list' => [
[
'element_id' => 123
]
],
'voice_list' => [
[
'voice_id' => '<string>'
]
],
'multi_shot' => true,
'shot_type' => '<string>',
'multi_prompt' => [
[
'index' => 123,
'prompt' => '<string>',
'duration' => '<string>'
]
],
'camera_control' => [
'type' => '<string>',
'config' => [
'horizontal' => 123,
'vertical' => 123,
'pan' => 123,
'tilt' => 123,
'roll' => 123,
'zoom' => 123
]
],
'static_mask' => '<string>',
'dynamic_masks' => [
[
'mask' => '<string>',
'trajectories' => [
[
'x' => 123,
'y' => 123
]
]
]
],
'real_person_mode' => true,
'file' => '<string>',
'link' => '<string>',
'tools' => [
[
'type' => '<string>'
]
]
],
'retries' => 0
]),
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://geekai.co/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"cogvideox-flash\",\n \"prompt\": \"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦\",\n \"negative_prompt\": \"<string>\",\n \"action\": \"auto\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"with_audio\": false,\n \"size\": \"720x720\",\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"quality\": \"speed\",\n \"duration\": 5,\n \"draft\": false,\n \"draft_task_id\": \"<string>\",\n \"fps\": 30,\n \"watermark\": false,\n \"output_format\": \"mp4\",\n \"async\": true,\n \"extra_body\": {\n \"draft\": false,\n \"return_last_frame\": false,\n \"movement_amplitude\": \"<string>\",\n \"camera_strength\": \"<string>\",\n \"image_list\": [\n {\n \"image_url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"video_list\": [\n {\n \"video_url\": \"<string>\",\n \"refer_type\": \"<string>\",\n \"keep_original_sound\": \"<string>\"\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"shot_type\": \"<string>\",\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"camera_control\": {\n \"type\": \"<string>\",\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"static_mask\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"real_person_mode\": true,\n \"file\": \"<string>\",\n \"link\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"<string>\"\n }\n ]\n },\n \"retries\": 0\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://geekai.co/api/v1/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"cogvideox-flash\",\n \"prompt\": \"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦\",\n \"negative_prompt\": \"<string>\",\n \"action\": \"auto\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"with_audio\": false,\n \"size\": \"720x720\",\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"quality\": \"speed\",\n \"duration\": 5,\n \"draft\": false,\n \"draft_task_id\": \"<string>\",\n \"fps\": 30,\n \"watermark\": false,\n \"output_format\": \"mp4\",\n \"async\": true,\n \"extra_body\": {\n \"draft\": false,\n \"return_last_frame\": false,\n \"movement_amplitude\": \"<string>\",\n \"camera_strength\": \"<string>\",\n \"image_list\": [\n {\n \"image_url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"video_list\": [\n {\n \"video_url\": \"<string>\",\n \"refer_type\": \"<string>\",\n \"keep_original_sound\": \"<string>\"\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"shot_type\": \"<string>\",\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"camera_control\": {\n \"type\": \"<string>\",\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"static_mask\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"real_person_mode\": true,\n \"file\": \"<string>\",\n \"link\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"<string>\"\n }\n ]\n },\n \"retries\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/videos/generations")
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\": \"cogvideox-flash\",\n \"prompt\": \"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦\",\n \"negative_prompt\": \"<string>\",\n \"action\": \"auto\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"with_audio\": false,\n \"size\": \"720x720\",\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"quality\": \"speed\",\n \"duration\": 5,\n \"draft\": false,\n \"draft_task_id\": \"<string>\",\n \"fps\": 30,\n \"watermark\": false,\n \"output_format\": \"mp4\",\n \"async\": true,\n \"extra_body\": {\n \"draft\": false,\n \"return_last_frame\": false,\n \"movement_amplitude\": \"<string>\",\n \"camera_strength\": \"<string>\",\n \"image_list\": [\n {\n \"image_url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"video_list\": [\n {\n \"video_url\": \"<string>\",\n \"refer_type\": \"<string>\",\n \"keep_original_sound\": \"<string>\"\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"shot_type\": \"<string>\",\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"camera_control\": {\n \"type\": \"<string>\",\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"static_mask\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"real_person_mode\": true,\n \"file\": \"<string>\",\n \"link\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"<string>\"\n }\n ]\n },\n \"retries\": 0\n}"
response = http.request(request)
puts response.read_body{
"model": "cogvideox-flash",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_status": "running",
"video_result": {
"id": "<string>",
"url": "<string>",
"cover_image_url": "<string>",
"duration": 123,
"revised_prompt": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": "validation_error",
"message": "参数验证失败",
"details": {
"field": "错误描述"
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}Select a video model. Supported parameters vary by provider; see the video model guides for examples.
Was this page helpful?
