- Omni-Flash-Ext 统一视频生成模型
- 支持文生视频、单图生视频、参考视频和 3 张参考图融合
- 支持 720p/1080p/4k 分辨率,4/6/8/10 秒时长
- 异步任务接口,提交后通过任务 ID 查询生成结果
请求示例
bash
curl --request POST \
--url https://api.openveer.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}'
```python
import requests
url = "https://api.openveer.com/v1/videos/generations"
payload = {
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}
headers = {
"Authorization": "Bearer
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = "https://api.openveer.com/v1/videos/generations";
const payload = {
model: "Omni-Flash-Ext",
prompt: "a girl is dancing happily in a sunny garden",
duration: 10,
resolution: "1080p",
aspect_ratio: "9:16"
};
const headers = {
"Authorization": "Bearer
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
```
```go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.openveer.com/v1/videos/generations"
payload := map[string]interface{}{
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
```
响应示例
json
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
}
]
}
json
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
json
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
json
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
json
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
认证
Authorization string请求参数
model stringprompt stringduration integerresolution stringaspect_ratio stringsize stringgeneration_type stringimage_urls stringvideo_urls string响应
code integerdata arraytask_id string查询任务结果
视频生成为异步任务。提交后会返回 task_id,使用 获取任务状态 接口查询生成进度和结果。
curl --request GET \
--url https://api.openveer.com/v1/tasks/task_01KS1H7ZYSJWH1N779S2FSHTKA \
--header 'Authorization: Bearer <token>'
建议提交后等待 5-10 秒再开始查询,后续每 5-10 秒轮询一次。单个任务通常约 3-5 分钟完成。
成功结果示例
{
"code": 200,
"data": {
"id": "task_01KS1H7ZYSJWH1N779S2FSHTKA",
"status": "completed",
"progress": 100,
"created": 1779246294,
"completed": 1779246534,
"actual_time": 240,
"estimated_time": 600,
"cost": 0.4,
"credits_cost": 4,
"result": {
"videos": [
{
"url": ["https://cdn.example.com/videos/abc.mp4"],
"expires_at": 1779332760
}
]
}
}
}
失败结果示例
{
"code": 200,
"data": {
"id": "task_01KS1H7ZYSJWH1N779S2FSHTKA",
"status": "failed",
"progress": 100,
"created": 1779246294,
"completed": 1779246534,
"actual_time": 240,
"estimated_time": 600,
"cost": 0,
"credits_cost": 0,
"error": {
"message": "invalid duration 7, must be one of 4/6/8/10",
"code": "task_failed"
}
}
}
使用场景
场景 1:文生视频
{
"model": "Omni-Flash-Ext",
"prompt": "a beautiful sunset over the ocean with seagulls flying",
"duration": 6,
"resolution": "720p",
"aspect_ratio": "16:9"
}
场景 2:单图生视频
{
"model": "Omni-Flash-Ext",
"prompt": "make the character smile and slowly turn around, cinematic camera motion",
"duration": 6,
"resolution": "1080p",
"aspect_ratio": "9:16",
"image_urls": ["https://example.com/character.jpg"]
}
场景 3:3 张参考图融合
{
"model": "Omni-Flash-Ext",
"prompt": "a creative scene combining these elements with smooth camera motion",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16",
"image_urls": [
"https://example.com/scene.jpg",
"https://example.com/character.jpg",
"https://example.com/product.jpg"
]
}
场景 4:4K 短视频
{
"model": "Omni-Flash-Ext",
"prompt": "close-up of a hummingbird hovering in front of a red flower",
"duration": 4,
"resolution": "4k",
"aspect_ratio": "16:9"
}
场景 5:参考视频生成
{
"model": "Omni-Flash-Ext",
"prompt": "the same scene but at night with neon lights",
"resolution": "720p",
"aspect_ratio": "16:9",
"video_urls": ["https://example.com/reference.mp4"]
}
错误码
| HTTP | 错误类型 | 含义 | 处理建议 |
|---|---|---|---|
| 400 | invalid_request_error |
model 不是 Omni-Flash-Ext、prompt 为空或 JSON 格式错误 |
检查请求体 |
| 400 | invalid_duration |
duration 不是 4、6、8 或 10 |
改成支持的时长 |
| 400 | invalid_resolution |
resolution 不是 720p、1080p 或 4k |
改成支持的分辨率 |
| 400 | unsupported_image_count |
image_urls 数量不受支持,常见于传入 2 张图 |
改成 0、1 或 3 张图片 |
| 400 | unsupported_video_count |
video_urls 数量不受支持,常见于传入 2 个及以上视频 |
改成 0 或 1 个参考视频 |
| 401 | authentication_error |
Token 无效 | 检查 Bearer Token |
| 402 | payment_required |
账户余额不足 | 充值后重试 |
| 429 | rate_limit_error |
触发限流 | 降低并发或稍后重试 |
任务失败时,任务查询接口会在 data.error 中返回失败原因。常见原因包括上游配额暂时耗尽、内容审核未通过或上游超时。