POST /v1/videos| model 参数 | 说明 |
|---|---|
nano_banana_2 | 标准版,速度快 |
nano_banana_pro | Pro 版,标准分辨率 |
nano_banana_pro-1K | Pro 版,1K 分辨率 |
nano_banana_pro-2K | Pro 版,2K 分辨率 |
nano_banana_pro-4K | Pro 版,4K 分辨率 |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 是 | Bearer YOUR_API_KEY |
| Content-Type | string | 是 | application/json |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 模型名称,如:nano_banana_2、nano_banana_pro、nano_banana_pro-1K 等 |
| prompt | string | 是 | 文本提示词,最大长度10000字符 |
| metadata | object | 否 | 元数据对象,包含图片生成的额外参数 |
| metadata.aspectRatio | string | 否 | 宽高比,可选值:1:1、9:16、16:9、auto,默认auto |
| metadata.urls | string[] | 否 | 参考图片数组(支持Base64或URL ),最多5张。传此参数为图生图模式,不传为文生图模式 |
| metadata.imageSize | string | 否 | 图片尺寸,如:1K、2K 等 |
{
"model": "nano_banana_2",
"prompt": "美丽的日出风景,金色的阳光洒在宁静的湖面上,远处是连绵的山脉",
"metadata": {
"aspectRatio": "16:9",
"urls": []
}
}| 参数名 | 类型 | 说明 |
|---|---|---|
| id | string | 任务ID,格式:task_nano_xxx 或 task_xxx |
| object | string | 对象类型,固定值:image |
| model | string | 使用的模型名称 |
| status | string | 任务状态:queued(排队中)、processing(处理中)、completed(已完成)、failed(失败) |
| progress | number | 任务进度,0-100 |
| created | number | 创建时间戳(秒) |
| url | string | 生成的图片URL(仅在completed状态返回) |
{
"id": "task_xxxxxxxxxxxxx",
"object": "image",
"model": "nano_banana_2",
"status": "queued",
"progress": 0,
"created": 1709876543
}{
"id": "task_xxxxxxxxxxxxx",
"object": "image",
"model": "nano_banana_2",
"status": "completed",
"progress": 100,
"created": 1709876543,
"url": "https://example.com/images/xxx.jpg"
}/v1/videos 接口,与视频生成共用,因为图片的newapi接口没有轮询,通过 model 参数区分(nano_banana 开头为图片生成)metadata 对象中data:image/jpeg;base64,)metadata.urls 为空数组或不传 = 文生图模式metadata.urls 包含图片(Base64或URL) = 图生图模式curl --location 'https://api.dyuapi.com/v1/videos' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano_banana_2",
"prompt": "美丽的日出风景,金色的阳光洒在宁静的湖面上,远处是连绵的山脉",
"metadata": {
"aspectRatio": "16:9",
"urls": [
"https://example.com/images/reference1.jpg",
"https://example.com/images/reference2.png"
]
}
}'{
"id": "task_xxxxxxxxxxxxx",
"object": "image",
"model": "nano_banana_2",
"status": "completed",
"progress": 100,
"created": 1709876543,
"url": "https://example.com/images/xxx.jpg"
}