Skip to main content
POST
gemini-3.1-flash-image-preview (Image Edit)

Authentication

  1. Sign up for a GPTProto account at https://gptproto.com
  2. Navigate to the API Keys section in your dashboard
  3. Generate a new API key (sk-xxxxx)
  4. Copy and securely store your API key For authentication details, please refer to the Authentication section.

Initiate Request

Parameters

Core Parameters

Model Comparison

Note:
  • Gemini 3.1 Flash Image Preview: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding.
  • Gemini 3 Pro Image Preview: Optimized for professional asset production with advanced reasoning for complex creation tasks.
  • Gemini 2.5 Flash Image: Supports a maximum of 3 reference images and 1K resolution only.

Aspect Ratio & Image Size

By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the aspect_ratio field under image_config in your request, as shown below: Gemini 2.5 Flash Image Gemini 3.1 Flash Image Preview Gemini 3 Pro Image Preview

Error Codes

Common Error Codes