Skip to main content
POST
/
api
/
v3
/
google
/
gemini-3-pro-image-preview
/
image-edit
gemini-3-pro-image-preview (Image Edit)
curl --request POST \
  --url https://gptproto.com/api/v3/google/gemini-3-pro-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

curl --location 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit' \
--header 'Authorization: GPTPROTO_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "prompt": "Put a hat on the cat",
  "images": [
    "https://tos.gptproto.com/resource/cat.png"
  ],
  "output_format": "jpeg",
  "size": "1K",
  "aspect_ratio": "1:1",
  "temperature": 1,
  "topP": 0.95,
  "enable_base64_output": false,
  "enable_sync_mode": false
}'

Query Result

If the request that generated your content includes the parameter enable_sync_mode set to true (some models do not support this parameter, but you still need to query the result by id), you must call the Query Result endpoint to retrieve the final output.
curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \
  -H "Authorization: GPTPROTO_API_KEY" \
  -H "Content-Type: application/json"
After submitting your prediction request, the response will contain the id you need.
You can find it in either:
  • data.id – the unique identifier of the prediction
  • data.urls[0].get – a ready-to-use GET URL that already embeds the id
{
    "data": {
        "id": "abc",
        "model": "model_name",
        "outputs": [],
        "urls": {
            "get": "https://gptproto.com/api/v3/predictions/abc/result"
        },
        "status": "completed",
        "error": null,
        "executionTime": 0,
        "timings": {
            "inference": 0
        },
        "has_nsfw_contents": [],
        "created_at": "2026-01-01 00:00:00"
    },
    "message": "success",
    "code": 200
}

Parameters

Path Parameters

Endpoint: https://gptproto.com/api/v3/google/{model}/{scene}
Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs.
sceneexample
text-to-videohttps://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image
image-to-videohttps://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit

Core Body Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstring✅ Yes--A text description of the desired image(s). The maximum length is 32000 characters.
imagearray❌ No--Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images.

Advanced Body Parameters

ParameterTypeRequiredDefaultRangeDescription
sizestring❌ No-0.5K
1K
2K
4K
Approximate size of the generated image. If not specified, the model will use the default value of 1K. 0.5K is only supported by Gemini 3.1 Flash Image Preview; 2K and 4K are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview.
aspect_ratiostring❌ No1:11:1
2:3
3:2
3:4
4:3
4:5
5:4
9:16
16:9
21:9
1:4
4:1
1:8
8:1
The aspect ratio of the generated image. 1:4, 4:1, 1:8, 8:1 are only supported by Gemini 3.1 Flash Image Preview.
temperaturenumber❌ No-0.0-1.0Controls the randomness of the output.
top_pnumber❌ No--Controls the diversity of the output.
enable_sync_modeboolean❌ Nofalsetrue
false
Whether to enable synchronous mode for image generation.
enable_base64_outputboolean❌ Nofalsetrue
false
Whether to enable base64 output for image generation.
output_formatstring❌ Nopngpng
jpg
jpeg
The format in which the generated images are returned.

Model Comparison

FeatureGemini 2.5 Flash ImageGemini 3.1 Flash Image PreviewGemini 3 Pro Image Preview
Use caseSpeed & efficiencySpeed & high-volumeProfessional asset production
Supported sizes1K0.5K, 1K, 2K, 4K1K, 2K, 4K
Max reference images31414
Max object images106
Max portrait images45
Extra aspect ratios1:4, 4:1, 1:8, 8:1
Google Image Search Grounding
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
Aspect ratioResolutionTokens
1:11024x10241290
2:3832x12481290
3:21248x8321290
3:4864x11841290
4:31184x8641290
4:5896x11521290
5:41152x8961290
9:16768x13441290
16:91344x7681290
21:91536x6721290
Gemini 3.1 Flash Image Preview
Aspect ratio512px resolution0.5K tokens1K resolution1K tokens2K resolution2K tokens4K resolution4K tokens
1:1512x5127471024x102411202048x204811204096x40962000
1:4256x1024747512x204811201024x409611202048x81922000
1:8192x1536747384x30721120768x614411201536x122882000
2:3424x632747848x126411201696x252811203392x50562000
3:2632x4247471264x84811202528x169611205056x33922000
3:4448x600747896x120011201792x240011203584x48002000
4:11024x2567472048x51211204096x102411208192x20482000
4:3600x4487471200x89611202400x179211204800x35842000
4:5464x576747928x115211201856x230411203712x46082000
5:4576x4647471152x92811202304x185611204608x37122000
8:11536x1927473072x38411206144x768112012288x15362000
9:16384x688747768x137611201536x275211203072x55042000
16:9688x3847471376x76811202752x153611205504x30722000
21:9792x3367471584x67211203168x134411206336x26882000
Gemini 3 Pro Image Preview
Aspect ratio1K resolution1K tokens2K resolution2K tokens4K resolution4K tokens
1:11024x102411202048x204811204096x40962000
2:3848x126411201696x252811203392x50562000
3:21264x84811202528x169611205056x33922000
3:4896x120011201792x240011203584x48002000
4:31200x89611202400x179211204800x35842000
4:5928x115211201856x230411203712x46082000
5:41152x92811202304x185611204608x37122000
9:16768x137611201536x275211203072x55042000
16:91376x76811202752x153611205504x30722000
21:91584x67211203168x134411206336x26882000

Error Codes

Common Error Codes

Error CodeError NameDescription
401UnauthorizedAPI key is missing or invalid
403ForbiddenYour API key doesn’t have permission to access this resource, or insufficient balance for the requested operation
429Too Many RequestsYou’ve exceeded your rate limit
500Internal server errorAn internal server error occurred
503Content policy violationContent blocked due to safety concerns (actual status code is 400)