Google Nano Banana 2 Edit

按实际用量计费
ae_nano_banana_2_edit

使用文字指令编辑、变换或组合一张或多张图像。

图像
按实际用量计费

价格说明

单次费用为(较大值(96 × 计费图像量, 0))AE积分。各项条件同时适用,按所选条件计算合计费用。

API 调用

通过统一工具网关发起同步请求,鉴权和计费由 AgentEarth 处理。

cURL
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_nano_banana_2_edit' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "request_body": {
      "prompt": "make a photo of the man driving the car down the california coastline",
      "image_urls": [
        "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png",
        "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png"
      ]
    }
  }
}'
请求方式
POST
接口地址
/agent-api/v1/tool/execute
鉴权方式
X-Api-Key
超时时间
60 秒
响应示例
{
  "error_no": 0,
  "error_msg": "",
  "result": [
    {
      "type": "text",
      "text": "xxx"
    }
  ],
  "platform_annotations": {
    "source": "AgentEarth",
    "platform_note": "xxx",
    "platform_suggestion": "xxx"
  }
}

工具参数

未传入的可选参数将使用平台默认值。

参数类型必填说明默认值
request_bodyobject是暂无参数说明。—
request_body.seedinteger | unknown否The seed for the random number generator.—
request_body.promptstring是The prompt for image editing.—
request_body.sync_modeboolean否If `True`, the media will be returned as a data URI and the output data won't be available in the request history.false
request_body.image_urlsarray是The URLs of the images to use for image-to-image generation or image editing.—
request_body.num_imagesinteger否The number of images to generate.1
request_body.resolutionenum (0.5K | 1K | 2K | 4K)否The resolution of the image to generate.1K
request_body.aspect_ratiostring | unknown否The aspect ratio of the generated image. Supports extreme ratios: 4:1, 1:4, 8:1, 1:8.auto
request_body.output_formatenum (jpeg | png | webp)否The format of the generated image.png
request_body.thinking_levelstring | unknown否When set, enables model thinking with the given level ('minimal' or 'high') and includes thoughts in the generation. Omit to disable.—
request_body.safety_toleranceenum (1 | 2 | 3 | 4 | 5 | 6)否The safety tolerance level for content moderation. 1 is the most strict (blocks most content), 6 is the least strict.4
request_body.enable_web_searchboolean否Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image.false
request_body.limit_generationsboolean否Experimental parameter to limit the number of generations from each round of prompting to 1. Set to `True` to to disregard any instructions in the prompt regarding the number of images to generate and ignore any intermediate images generated by the model. This may affect generation quality.true