Skip to main content
POST
/
v1
/
images
/
generations
gpt-4o-image-vip (Text to Image)
curl --request POST \
  --url https://api.example.com/v1/images/generations

API Key Authentication

GPTProto API uses Bearer token authentication. All API requests must include your API key (sk-xxxxx) in the Authorization header.

Getting Your API Key

  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
  4. Copy and securely store your API key For authentication details, please refer to the Authentication section.

Initiate Request

curl --location --request POST "https://gptproto.com/v1/images/generations" \
--header "Authorization: GPTPROTO_API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
    "model": "gpt-4o-image-vip",
    "prompt": "a cat",
    "size": "1024x1024"
}'

Response Example

{
    "created": 1765953949,
    "background": "opaque",
    "data": [
        {"b64_json": "B64_JSON_DATA"}
    ],
    "output_format": "png",
    "quality": "high",
    "size": "1024x1024",
    "usage": {
        "input_tokens": 12,
        "input_tokens_details": {
            "image_tokens": 0,
            "text_tokens": 12
        },
        "output_tokens": 4467,
        "output_tokens_details": {
            "image_tokens": 4160,
            "text_tokens": 307
        },
        "total_tokens": 4479
    }
}

Parameters

Core Parameters

ParameterTypeRequiredDefaultRangeDescription
modelstring✅ Yesgpt-image-1-The model to use for image editing. Defaults to gpt-image-1.
promptstring✅ Yes--A text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1.
imagestring or file❌ No--For gpt-image-1, each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images.

Advanced Parameters

ParameterTypeRequiredDefaultRangeDescription
maskfile❌ No--An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.
ninteger❌ No11-10The number of images to generate. Must be between 1 and 10.
sizestring❌ Noauto256x256
512x512
1024x1024
1536x1024
1024x1536
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2, and one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3.
qualitystring❌ Noautohigh
medium
low
The quality of the generated images. Must be one of low, high or medium. Defaults to auto.
backgroundstring❌ Noautotransparent
opaque
auto
Allows to set transparency for the background of the generated image(s). Must be one of transparent, opaque or auto (default value). When auto is used, the model will automatically determine the best background for the image.

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)