Skip to main content
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": "<string>",
  "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>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
prompt
string
required

The prompt which used to generate the images

action
enum<string>
required

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

Available options:
edit,
generate
Example:

"generate"

num_images
number
default: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.

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

The aspect ratio of the image

Available options:
21:9,
1:1,
4:3,
3:2,
2:3,
5:4,
4:5,
3:4,
16:9,
9:16
Example:

"1:1"

model
enum<string>
default:nano-banana-fast

The model of the image, default is NanoBananaFast

Available options:
nano-banana-fast,
nano-banana-pro
Example:

"nano-banana-fast"

resolution
enum<string>

The resolution of the image, only valid when model is NanoBananaPro

Available options:
1K,
2K,
4K
Example:

"1K"

Response

201 - application/json
taskId
string
required

task id, used to get task result later