https://api.nki.pw/API/ai_video.php
示例地址:https://api.nki.pwhtai_video.php?prompt=有一个黑人拿着一个水杯然后说你好&type=text_to_video
文转视频或图转视频,由 飞龙网盘 提供
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| video_id | string | 是 | 条件必填 要查询的视频任务 ID。如果提供此参数,则进入查询模式,忽略 type 等其他参数 创建模式 |
| type | string | 是 | text_to_video 或 image_to_video(仅在未提供 video_id 时必填) |
| prompt | string | 是 | 视频内容描述 |
| image_url | string | 是 | 当 type=image_to_video 时必填 初始图片 URL(需公网可访问) |
| duration | integer | 否 | 期望视频时长(秒),默认 5,可选 3/5/10/18 |
| width | integer | 否 | 视频宽度,默认 1152 |
| height | integer | 否 | 视频高度,默认 768 |
| frame_rate | integer | 否 | 帧率(fps),默认 24,范围 1~60 |
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功,服务器已成功处理了请求。 |
| 403 | 服务器拒绝请求。这可能是由于缺少必要的认证凭据(如API密钥)或权限不足。 |
| 404 | 请求的资源未找到。请检查您的请求地址是否正确。 |
| 429 | 请求过于频繁。您已超出速率限制,请稍后再试。 |
| 500 | 服务器内部错误。服务器在执行请求时遇到了问题。 |
此处将显示接口返回结果...
<?php
$url = 'https://api.nki.pw/API/ai_video.php';
$params = ['video_id' => 'YOUR_VALUE', 'type' => 'YOUR_VALUE', 'prompt' => 'YOUR_VALUE', 'image_url' => 'YOUR_VALUE', 'duration' => 'YOUR_VALUE', 'width' => 'YOUR_VALUE', 'height' => 'YOUR_VALUE', 'frame_rate' => 'YOUR_VALUE', ];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>import requests
url = "https://api.nki.pw/API/ai_video.php"
params = {
'video_id': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
'prompt': 'YOUR_VALUE',
'image_url': 'YOUR_VALUE',
'duration': 'YOUR_VALUE',
'width': 'YOUR_VALUE',
'height': 'YOUR_VALUE',
'frame_rate': 'YOUR_VALUE',
}
response = requests.get(url, params=params)
print(response.text)const url = new URL('https://api.nki.pw/API/ai_video.php');
const params = {
'video_id': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
'prompt': 'YOUR_VALUE',
'image_url': 'YOUR_VALUE',
'duration': 'YOUR_VALUE',
'width': 'YOUR_VALUE',
'height': 'YOUR_VALUE',
'frame_rate': 'YOUR_VALUE',
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
fetch(url)
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));