AI GPT ImageAI GPT Image
Image ModelsNano Banana

Nano Banana Image to Image API

Get API Keynano-banana-image-to-image

Create Task

POST https://aigptimage.com/api/v1/jobs/createTask
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input Parameters

FieldTypeRequiredDescription
promptstringYesEdit instruction. Max 20000 characters
image_urlsstring[]YesPublic HTTPS input image URLs. Up to 10 images
image_sizestringNoOutput ratio. Options: 1:1, 9:16, 16:9, 3:4, 4:3, 3:2, 2:3, 5:4, 4:5, 21:9, auto. Default: 1:1
aspect_ratiostringNoAlias for image_size
output_formatstringNopng or jpeg. Default: png
nsfw_checkerbooleanNoWhether to enable provider safety checking. Default: true

Source Image Requirements

  • Use public https:// image URLs.
  • Supported formats: JPEG/JPG, PNG, WEBP.
  • Max size: 10MB per image.
  • Do not send local file paths, binary uploads, raw base64 strings, or inline data:image/...;base64,... URLs.

Request Example

{
  "model": "nano-banana-image-to-image",
  "input": {
    "prompt": "Turn this photo into a collectible character figure with packaging in the background",
    "image_urls": ["https://cdn.example.com/input.png"],
    "image_size": "1:1",
    "output_format": "png"
  }
}

Create Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_xxxxxxxxxxxxx"
  }
}

Save data.taskId; you need it to query the result.

Query Task

GET https://aigptimage.com/api/v1/jobs/recordInfo?taskId=task_xxxxxxxxxxxxx
Authorization: Bearer YOUR_API_KEY

When data.state is success, parse data.resultJson as JSON and read resultUrls.

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_xxxxxxxxxxxxx",
    "model": "nano-banana-image-to-image",
    "state": "success",
    "param": "{\"model\":\"nano-banana-image-to-image\",\"input\":{\"prompt\":\"Turn this photo into a collectible character figure with packaging in the background\",\"image_urls\":[\"https://cdn.example.com/input.png\"],\"image_size\":\"1:1\",\"output_format\":\"png\"}}",
    "resultJson": "{\"resultUrls\":[\"https://cdn.example.com/result.png\"]}",
    "failCode": null,
    "failMsg": null,
    "costTime": 12000,
    "completeTime": 1757584176490,
    "createTime": 1757584164490
  }
}

Error Codes

Status CodeDescription
400Invalid request parameters
401Authentication failed or API key is invalid
402Insufficient credits
404Task not found
409Active task limit exceeded or request conflict
422Parameter validation failed
429Request rate limit exceeded
500Internal server error