> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnimux.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# Nano Banana 2.1 生图

> Nano Banana 2.1 生图 · model `nano-banana-2-1`

* 调用 `POST /v1/images/generations`，`model` 为 `nano-banana-2-1`
* 请求体至少包含 `model` 与 `prompt`
* 异步任务：创建响应返回 `task_id`，以控制台日志/任务结果为准

## 身份

| 字段 | 值 |
| - | - |
| 系列 | 图像系列 |
| 品牌 | Nano Banana |
| model | `nano-banana-2-1` |

## 接口

| 方法 | 路径 |
| - | - |
| `POST` | `/v1/images/generations` |

Base URL：`https://api.omnimux.ai`

## 鉴权

| 名称 | 位置 | 类型 | 必填 | 说明 |
| - | - | - | - | - |
| `Authorization` | header | string | 是 | `Bearer sk-...`（API Key） |

## 请求体

| 字段 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 固定为 `nano-banana-2-1` |
| `prompt` | string | 是 | 图像描述 |
| `resolution` | string | 否 | `1K` / `2K` / `4K`；未传时网关默认 `2K` |
| `size` | string | 否 | 画面比例（如 `1:1`、`16:9`、`9:16` 等 14 种）或 `auto`（运行时接受，等同默认） |
| `n` | integer | 否 | **固定为 1**，不支持批量 |

### 能力面（MVP）

| 项目 | 值 |
| - | - |
| 文生图 | 支持 |
| 参考图 / 图生图 / 编辑 | 暂不支持：`image`、`image_urls`、`images`、`input_reference` 非空或 `layer_decomposition=true` 会被拒绝（400） |
| 付费增强参数 | 暂不支持：`model_params`（如 web\_search / image\_search）会被拒绝（400） |
| 生成张数 | 1 |

## 计费

按 `resolution` 每张固定价：`1K` = **$0.034**，`2K` = **$0.051**，`4K` = **\$0.114**。未传 `resolution` 时按 `2K` 计费；`n` 固定为 1。

## 响应

### 200

| 字段 | 类型 | 说明 |
| - | - | - |
| `task_id` / `id` | string | 异步任务 id |
| `data` | array | 结果（异步完成后读取） |

错误形态见右栏示例；失败任务自动全额退款。

```bash cURL theme={null}
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-1",
  "prompt": "a red apple on a table, studio light",
  "resolution": "2K",
  "size": "16:9"
}'
```

```json 200 theme={null}
{ "task_id": "task_xxx", "status": "queued", "model": "nano-banana-2-1" }
```

```json 400 theme={null}
{ "error": { "message": "nano-banana-2-1 resolution must be one of 1K, 2K, 4K", "type": "invalid_request_error", "code": "invalid_request" } }
```

```json 402 theme={null}
{ "error": { "message": "Insufficient quota. Please top up your account.", "type": "insufficient_quota", "code": "insufficient_quota" } }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.