Skip to main content
POST
/
ai
/
gi
/
image
/
generate
banana generate image
curl --request POST \
  --url https://ai.pmock.com/api/ai/gi/image/generate \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "action": "edit",
  "numImages": 123,
  "model": "nano-banana-fast",
  "resolution": "1K",
  "imageUrls": [
    "<string>"
  ],
  "aspectRatio": "1:1"
}
'
{
  "code": 200,
  "message": "<string>",
  "data": {
    "taskId": "<string>"
  },
  "traceId": "<string>"
}

Body

application/json
prompt
string
required

The prompt words used to generate images

Minimum string length: 1
action
enum<string>
required

Action type, edit (modify existing image) or generate (create new image)

Available options:
edit,
generate
numImages
integer<int32>
required

only support generate 1 image

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

The model used to generate images

Available options:
nano-banana-fast,
nano-banana-pro
resolution
enum<string>
default:1K

The resolution used to generate images

Available options:
1K,
2K,
4K
imageUrls
string[]

The image link that needs to be edited. It can be an accessible HTTP or HTTPS URL, with each image size not exceeding 10MB. If the action is edit, this parameter is required

aspectRatio
enum<string>
default:1:1

The aspect ratio of the image is 1:1 by default

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

Response

200 - */*

OK

Unified return structure for response results

code
integer<int32>

Response status code

Example:

200

message
string

Response message

data
object

Response result

traceId
string

Response traceId