Skip to main content
POST
/
v1
/
images
/
edits
GPT-Image-2-Plus | Image Edit
curl --request POST \
  --url https://gptproto.com/v1/images/edits

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/v1/images/edits' \
--header 'Authorization: GPTPROTO_API_KEY' \
--form 'model="gpt-image-2-plus"' \
--form 'image[]=@"/path/to/file"' \
--form 'prompt="Put a hat on the cat"'

{
    "data": [
        {
            "b64_json": "data:image/png;base64,<BASE64_DATA>"}
    ],
    "created": 1776841668
}

Parameters

ParameterTypeRequiredDefaultRangeDescription
modelstring✅ Yes-gpt-image-1.5-plus
gpt-image-2-plus
The model to use for image generation.
promptstring✅ Yes--A text description of the desired image(s). The maximum length is 32000 characters.
sizestring❌ Noautoauto
1536x1024
1024x1536
1672x941
941x1672
The size of the generated images.

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)