curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana-2",
"prompt": "a product photo on white background",
"n": 1
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" }
}
{
"error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" }
}
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{
"error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" }
}
{
"error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" }
}
{
"error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" }
}
curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana-2",
"prompt": "a product photo on white background",
"n": 1
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" }
}
{
"error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" }
}
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{
"error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" }
}
{
"error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" }
}
{
"error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" }
}
Nano Banana
Nano Banana 2 生图
Nano Banana 2 生图 · model nano-banana-2
curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana-2",
"prompt": "a product photo on white background",
"n": 1
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" }
}
{
"error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" }
}
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{
"error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" }
}
{
"error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" }
}
{
"error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" }
}
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana-2",
"prompt": "a product photo on white background",
"n": 1
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" }
}
{
"error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" }
}
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{
"error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" }
}
{
"error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" }
}
{
"error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" }
}
- 调用
POST /v1/images/generations,model为nano-banana-2 - 请求体至少包含
model与prompt - 同步或异步以线上响应为准;若返回 task id,请用任务查询接口轮询
身份
| 字段 | 值 |
|---|---|
| 系列 | 图像系列 |
| 品牌 | Nano Banana |
| model | nano-banana-2 |
接口
| 方法 | 路径 |
|---|---|
POST | /v1/images/generations |
https://api.omnimux.ai
鉴权
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
Authorization | header | string | 是 | Bearer sk-...(API Key) |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 nano-banana-2 |
prompt | string | 是 | 图像描述 / 编辑说明 |
n | integer | 否 | 生成张数(受网关上限约束) |
size | string | 否 | 尺寸或宽高比(模型相关) |
quality | string | 否 | 质量档位(模型相关) |
images | string[] | 否 | 参考图:图片 URL 或 base64;image、image_urls、input_reference 为可接受的别名,调用上游前统一归一为 images。 |
参考图限制
| 项目 | 值 |
|---|---|
| 单次参考图上限 | 14 张 |
| 单次参考图下限 | 无 —— 文生图不传 images |
| 接受格式 | image/png、image/jpeg、image/webp、image/heic、image/heif |
| 单文件大小上限 | 内联(base64)上传 7 MB;经 Google Cloud Storage 导入 30 MB |
响应
200
| 字段 | 类型 | 说明 |
|---|---|---|
created | integer | 创建时间戳(若返回) |
data | array | 图像结果(url 或 b64_json) |
task_id / id | string | 异步时的任务 id(若返回) |
task_id / 控制台日志为准(公开文档不提供独立图像 query 路径)。