Skip to main content
POST
/
api
/
v3
/
openai
/
gpt-image-2-plus
/
image-edit
GPT-Image-2-Plus | Image Edit
curl --request POST \
  --url https://gptproto.com/api/v3/openai/gpt-image-2-plus/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/openai/gpt-image-2-plus/image-edit' \
--header 'Authorization: GPTPROTO_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "images": [
    "https://tos.gptproto.com/resource/cat.png"
  ],
  "prompt": "Girl holding cat",
  "quality": "medium",
  "size": "1024x1024",
  "background": "auto",
  "enable_sync_mode": false,
  "response_format": "url"
}'

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

Core Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstring✅ Yes-1–32000 charsA text description of the desired image(s). The maximum length is 32000 characters.
ninteger❌ No11-10The number of images to generate. Must be between 1 and 10.
sizestring❌ No1024x10241024x1024
1536x1024
1024x1536
2048x2048
2048x1152
3840x2160
2160x3840
or any valid custom size
The size of the generated images. For gpt-image-1: one of 1024x1024, 1536x1024, or 1024x1536. For gpt-image-2: supports arbitrary resolutions (max edge ≤ 3840px, both sides must be multiples of 16px, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400).
qualitystring❌ Noautoauto
high
medium
low
The quality of the generated images. One of auto, low, medium, or high. Defaults to auto. Not supported by -plus suffixed models.
enable_sync_modeboolean❌ Nofalsetrue
false
Whether to enable synchronous mode for image generation. When enabled, the API will wait until the image is fully generated before returning the response.
response_formatstring❌ Nourlurl
b64_json
The format in which the generated images are returned. url returns a temporary URL, b64_json returns base64-encoded JSON.

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)