统一视频生成接口
curl --request POST \
--url https://www.geeknow.top/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"image": "<string>",
"images": [
"<string>"
],
"input_reference": [
"<string>"
],
"duration": 123,
"seconds": "<string>",
"size": "<string>",
"metadata": {}
}
'import requests
url = "https://www.geeknow.top/v1/video/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"image": "<string>",
"images": ["<string>"],
"input_reference": ["<string>"],
"duration": 123,
"seconds": "<string>",
"size": "<string>",
"metadata": {}
}
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>',
image: '<string>',
images: ['<string>'],
input_reference: ['<string>'],
duration: 123,
seconds: '<string>',
size: '<string>',
metadata: {}
})
};
fetch('https://www.geeknow.top/v1/video/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://www.geeknow.top/v1/video/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' => '<string>',
'prompt' => '<string>',
'image' => '<string>',
'images' => [
'<string>'
],
'input_reference' => [
'<string>'
],
'duration' => 123,
'seconds' => '<string>',
'size' => '<string>',
'metadata' => [
]
]),
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://www.geeknow.top/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"input_reference\": [\n \"<string>\"\n ],\n \"duration\": 123,\n \"seconds\": \"<string>\",\n \"size\": \"<string>\",\n \"metadata\": {}\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://www.geeknow.top/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"input_reference\": [\n \"<string>\"\n ],\n \"duration\": 123,\n \"seconds\": \"<string>\",\n \"size\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.geeknow.top/v1/video/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\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"input_reference\": [\n \"<string>\"\n ],\n \"duration\": 123,\n \"seconds\": \"<string>\",\n \"size\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "video_task_abc123",
"task_id": "video_task_abc123",
"object": "video",
"model": "kling-v1",
"status": "queued",
"progress": 0,
"created_at": 1735689600
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "无效的令牌",
"type": "new_api_error",
"param": "",
"code": "invalid_api_key"
}
}
{
"error": {
"message": "用户额度不足",
"type": "new_api_error",
"param": "",
"code": "insufficient_user_quota"
}
}
{
"code": "too_many_requests",
"message": "当前分组上游负载已饱和,请稍后再试",
"data": null
}
{
"error": {
"message": "copy_response_body_failed",
"type": "new_api_error",
"param": "",
"code": "bad_response"
}
}
统一视频生成接口
使用平台统一视频任务格式提交异步生成任务,适配多家视频模型和供应商。
POST
https://www.geeknow.top
/
v1
/
video
/
generations
统一视频生成接口
curl --request POST \
--url https://www.geeknow.top/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"image": "<string>",
"images": [
"<string>"
],
"input_reference": [
"<string>"
],
"duration": 123,
"seconds": "<string>",
"size": "<string>",
"metadata": {}
}
'import requests
url = "https://www.geeknow.top/v1/video/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"image": "<string>",
"images": ["<string>"],
"input_reference": ["<string>"],
"duration": 123,
"seconds": "<string>",
"size": "<string>",
"metadata": {}
}
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>',
image: '<string>',
images: ['<string>'],
input_reference: ['<string>'],
duration: 123,
seconds: '<string>',
size: '<string>',
metadata: {}
})
};
fetch('https://www.geeknow.top/v1/video/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://www.geeknow.top/v1/video/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' => '<string>',
'prompt' => '<string>',
'image' => '<string>',
'images' => [
'<string>'
],
'input_reference' => [
'<string>'
],
'duration' => 123,
'seconds' => '<string>',
'size' => '<string>',
'metadata' => [
]
]),
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://www.geeknow.top/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"input_reference\": [\n \"<string>\"\n ],\n \"duration\": 123,\n \"seconds\": \"<string>\",\n \"size\": \"<string>\",\n \"metadata\": {}\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://www.geeknow.top/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"input_reference\": [\n \"<string>\"\n ],\n \"duration\": 123,\n \"seconds\": \"<string>\",\n \"size\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.geeknow.top/v1/video/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\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"input_reference\": [\n \"<string>\"\n ],\n \"duration\": 123,\n \"seconds\": \"<string>\",\n \"size\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "video_task_abc123",
"task_id": "video_task_abc123",
"object": "video",
"model": "kling-v1",
"status": "queued",
"progress": 0,
"created_at": 1735689600
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "无效的令牌",
"type": "new_api_error",
"param": "",
"code": "invalid_api_key"
}
}
{
"error": {
"message": "用户额度不足",
"type": "new_api_error",
"param": "",
"code": "insufficient_user_quota"
}
}
{
"code": "too_many_requests",
"message": "当前分组上游负载已饱和,请稍后再试",
"data": null
}
{
"error": {
"message": "copy_response_body_failed",
"type": "new_api_error",
"param": "",
"code": "bad_response"
}
}
统一视频生成接口
这是面向多供应商的视频任务入口。请求先进入统一任务协议,再由分发层选择实际渠道执行。- 一个入口同时支持文生视频和图生视频。
- 异步处理模式,提交成功后返回公开视频任务 ID。
- 支持通过
metadata透传供应商专有参数。 - 可与
/v1/video/generations/{task_id}和/v1/videos/{task_id}组成完整任务链路。
方法与路径
POST /v1/video/generations
请求示例
curl -X POST https://www.geeknow.top/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v1",
"prompt": "一只金毛犬在海滩上奔跑,镜头平滑跟随",
"duration": 5,
"size": "1280x720",
"metadata": {
"style": "cinematic"
}
}'
import requests
resp = requests.post(
"https://www.geeknow.top/v1/video/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "kling-v1",
"prompt": "一只金毛犬在海滩上奔跑,镜头平滑跟随",
"duration": 5,
"size": "1280x720",
"metadata": {"style": "cinematic"},
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://www.geeknow.top/v1/video/generations", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "kling-v1",
prompt: "一只金毛犬在海滩上奔跑,镜头平滑跟随",
duration: 5,
size: "1280x720",
metadata: { style: "cinematic" },
}),
});
console.log(await response.json());
响应示例
{
"id": "video_task_abc123",
"task_id": "video_task_abc123",
"object": "video",
"model": "kling-v1",
"status": "queued",
"progress": 0,
"created_at": 1735689600
}
{
"error": {
"message": "prompt is required",
"type": "new_api_error",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "无效的令牌",
"type": "new_api_error",
"param": "",
"code": "invalid_api_key"
}
}
{
"error": {
"message": "用户额度不足",
"type": "new_api_error",
"param": "",
"code": "insufficient_user_quota"
}
}
{
"code": "too_many_requests",
"message": "当前分组上游负载已饱和,请稍后再试",
"data": null
}
{
"error": {
"message": "copy_response_body_failed",
"type": "new_api_error",
"param": "",
"code": "bad_response"
}
}
认证
Authorization: Bearer YOUR_API_KEY
Body
Response
使用场景
文生视频
curl -X POST https://www.geeknow.top/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3",
"prompt": "一辆红色跑车在雨夜城市中穿行",
"seconds": "5"
}'
图生视频
curl -X POST https://www.geeknow.top/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v1",
"prompt": "让人物微笑并挥手",
"image": "https://.../portrait.png",
"duration": 5
}'
注意事项
这个路由是统一任务入口,不保证所有渠道都接受同一组参数。未在适配器中识别的字段可能被忽略,也可能只对某些模型生效。