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

# Nano Banana Pro

> Google Gemini 3 Pro Image，画质和文字渲染最强，适合海报和带文字的设计图。

* 模型 ID：`nano-banana-pro`
* 接口：`POST https://token.poryf.com/v1/images/generations`（同步返回）
* [查看价格](https://token.poryf.com/pricing/nano-banana-pro) · [在线试用](https://token.poryf.com/model-guide/nano-banana-pro)（登录后，按自己的余额扣费）

## 请求参数

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY`，在 [控制台的 API 密钥页](https://token.poryf.com/keys) 创建。
</ParamField>

<ParamField body="model" type="string" required>
  `nano-banana-pro`
</ParamField>

<ParamField body="prompt" type="string" required>
  画面描述。
</ParamField>

<ParamField body="resolution" type="string" default="1K">
  输出分辨率：`1K`、`2K`、`4K`。
</ParamField>

<ParamField body="aspect_ratio" type="string">
  画面比例：`1:1`、`2:3`、`3:2`、`3:4`、`4:3`、`4:5`、`5:4`、`9:16`、`16:9`、`21:9`。不传时由模型决定；传了 `size`（如 `1536x1024`）时取最接近的比例。
</ParamField>

<ParamField body="image" type="string | string[]">
  参考图的公网 URL，最多 14 张，传数组。传了参考图即为图生图 / 图片编辑。
</ParamField>

<ParamField body="negative_prompt" type="string">
  不希望出现在画面里的内容。
</ParamField>

<ParamField body="seed" type="integer">
  随机种子。
</ParamField>

<ParamField body="output_format" type="string">
  `png` 或 `jpeg`。
</ParamField>

## 示例：文生图

```bash theme={null}
curl https://token.poryf.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "秋日咖啡店的拿铁海报，暖色调，留出标题位置",
    "resolution": "2K",
    "aspect_ratio": "3:4"
  }'
```

## 示例：参考图生图

```bash theme={null}
curl https://token.poryf.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "把这张产品图换成纯白背景，保持商品不变",
    "image": ["https://example.com/product.jpg"]
  }'
```

## 响应

示例结构：

```json theme={null}
{
  "data": [
    { "url": "https://example.com/generated/xxxx.png" }
  ]
}
```

## 计费

按张计费，1K 与 2K 同价，4K 单独一档。按实际生成成功的张数结算，失败不扣费。

<Warning>
  * Nano Banana 与可灵的参考图只接受公网可访问的 `http(s)` URL，不支持上传文件或 Base64。
  * 生成结果是临时链接：GPT Image 约 24 小时失效，Nano Banana 与可灵约 7 天失效。请及时下载转存。
  * 接口同步返回，出图可能需要 1–2 分钟，请把客户端超时设为 5 分钟以上，避免重复提交导致重复扣费。
</Warning>

实时单价见 [模型广场](https://token.poryf.com/pricing)。通用字段、响应格式和常见错误见 [图片通用说明](/api/images/overview)。


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