APIshop Documentation
Image Generation

NanoBanana Image Generation Deployment Guide

Explains how to call Gemini's native image generation API through APIshop and how to edit images.

资源地址
APIshop Platformhttps://apishop.ai

核心能力

  • Supports both NanoBananaPro and NanoBanana2 models
  • Supports multiple aspect ratios and resolutions
  • Compatible with image-to-image editing capabilities
步骤 1

Confirm the model and size

  • - Choose the Pro or Flash model based on your needs.
  • - Confirm the aspect ratio and resolution to use.
步骤 2

Prepare the API request

  • - Use Gemini's native format for the request body.
  • - Set `responseModalities` to `["IMAGE"]`.
步骤 3

Submit the generation request

  • - Call `v1beta/models/{model}:generateContent`.
  • - Save the returned Base64 image content as a PNG or another file format.
步骤 4

Image-to-image editing

  • - Upload an image and attach editing instructions.
  • - You can modify the background, style, and elements.

注意事项

  • - Image generation time is related to resolution; it is recommended to set a reasonable timeout based on the scenario.
  • - This API uses Gemini's native format, not the OpenAI-compatible format.