跳转到主要内容
POST
/
api
/
v1
/
nanobanana
/
generate-pro
生成图像 (Pro)
curl --request POST \
  --url https://api.nanobananaapi.ai/api/v1/nanobanana/generate-pro \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A cute cat is eating.",
  "imageUrls": [
    ""
  ],
  "resolution": "2K",
  "callBackUrl": "https://example-callback.com",
  "aspectRatio": "16:9"
}
'
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}

重要说明

  • 响应中返回的任务 ID 用于通过获取任务详情接口查询任务状态
  • 回调 URL 通知会在任务完成时立即发送

Authorizations

Authorization
string
header
required

所有 API 都需要通过 Bearer Token 进行身份验证。

获取 API Key:

  1. 访问 API Key 管理页面 获取您的 API Key

使用方法: 在请求头中添加: Authorization: Bearer YOUR_API_KEY

注意:

  • 请保护您的 API Key 安全,不要与他人分享
  • 如果您怀疑 API Key 已泄露,请立即在管理页面重置

Body

application/json
prompt
string
required

您想要生成的图像的文本描述

Example:

"A cute cat is eating."

imageUrls
string<uri>[]

用于转换或作为参考的输入图像(最多支持 8 张图像)

Maximum array length: 8
Example:
[""]
resolution
enum<string>

生成图像的分辨率

可用选项:
1K,
2K,
4K
Example:

"2K"

callBackUrl
string<uri>

回调地址,用于接收任务完成通知(必填)

Example:

"https://example-callback.com"

aspectRatio
enum<string>

生成图像的宽高比

可用选项:
1:1,
2:3,
3:2,
3:4,
4:3,
4:5,
5:4,
9:16,
16:9,
21:9,
auto
Example:

"16:9"

Response

200 - application/json

请求成功

code
integer

响应状态码

Example:

200

message
string

响应消息

Example:

"success"

data
object