跳转到主要内容
POST
/
gemini
/
image
/
generate
Nano Banana image generation
curl --request POST \
  --url https://api.mountsea.ai/gemini/image/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A fluffy orange cat running through a sunny meadow",
  "action": "generate",
  "num_images": 1,
  "image_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "aspect_ratio": "1:1",
  "model": "nano-banana-fast",
  "resolution": "1K"
}
'
{
  "taskId": "<string>"
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
prompt
string
必填

The prompt which used to generate the images

示例:

"A fluffy orange cat running through a sunny meadow"

action
enum<string>
必填

Action type: edit (modify existing images) or generate (create new images)

可用选项:
edit,
generate
示例:

"generate"

num_images
number
默认值:1

only support generate 1 image, default is 1

image_urls
string<uri>[]

Link to the picture that needs to be edited. It can be a accessible http or https url, The image size should not exceed 10MB for each. If the action is edit, this parameter is required.

示例:
[
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
aspect_ratio
enum<string>

The aspect ratio of the image,nano-banana-2 support all aspect ratios, other models only support 21:9, 1:1, 4:3, 3:2, 2:3, 5:4, 4:5, 3:4, 16:9, 9:16

可用选项:
21:9,
1:1,
4:3,
3:2,
2:3,
5:4,
4:5,
3:4,
16:9,
9:16,
1:4,
4:1,
1:8,
8:1
示例:

"1:1"

model
enum<string>
默认值:nano-banana-fast

The model of the image, default is NanoBananaFast

可用选项:
nano-banana-fast,
nano-banana-pro,
nano-banana-2
示例:

"nano-banana-fast"

resolution
enum<string>

The resolution of the image, only valid when model is nano-banana-pro or nano-banana-2

可用选项:
1K,
2K,
4K
示例:

"1K"

响应

201 - application/json
taskId
string
必填

task id, used to get task result later