> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gptproto.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-Image-1-Vip - Text To Image

> Premium text to image by gpt image 1 vip. Breathtaking AI art generation with exclusive quality and detail.

## Authentication

1. Sign up for a GPTProto account at [https://gptproto.com](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](https://docs.gptproto.com/authentication.md) section.

## Initiate Request

```bash cURL theme={null}
curl --location 'https://gptproto.com/v1/images/generations' \
--header 'Authorization: GPTPROTO_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "model": "gpt-image-1-vip",
  "prompt": "a cat",
  "size": "1024x1024"
}'

```

```javascript JavaScript theme={null}
const axios = require('axios');
let data = JSON.stringify({
  "model": "gpt-image-1-vip",
  "prompt": "a cat",
  "size": "1024x1024"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://gptproto.com/v1/images/generations',
  headers: { 
    'Authorization': 'GPTPROTO_API_KEY', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});


```

```python Python theme={null}
import requests
import json

url = "https://gptproto.com/v1/images/generations"

payload = json.dumps({
  "model": "gpt-image-1-vip",
  "prompt": "a cat",
  "size": "1024x1024"
})
headers = {
  'Authorization': 'GPTPROTO_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)


```

```go Go theme={null}
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://gptproto.com/v1/images/generations"
  method := "POST"

  payload := strings.NewReader(`{
  "model": "gpt-image-1-vip",
  "prompt": "a cat",
  "size": "1024x1024"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "GPTPROTO_API_KEY")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

```

> [accordion] Response Example
>
> ```json theme={null}
> {
>   "created": 1776843003,
>   "background": "opaque",
>   "data": [
>     {
>       "b64_json": "<BASE64_DATA>"
>     }
>   ],
>   "output_format": "png",
>   "quality": "low",
>   "size": "1024x1024",
>   "usage": {
>     "input_tokens": 8,
>     "input_tokens_details": {
>       "image_tokens": 0,
>       "text_tokens": 8
>     },
>     "output_tokens": 196,
>     "output_tokens_details": {
>       "image_tokens": 196,
>       "text_tokens": 0
>     },
>     "total_tokens": 204
>   }
> }
> ```

## Parameters

> [tab] Text to Image
>
> | Parameter | Type | Required | Default | Range | Description |
> | - | - | - | - | - | - |
> | `model` | string | ✅ Yes | `gpt-image-1` | `gpt-image-1` `gpt-image-1-mini` `gpt-image-1.5` `gpt-image-2` | The model to use for image generation. Defaults to gpt-image-1. |
> | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. |
> | `n` | integer | ❌ No | `1` | `1-10` | The number of images to generate. Must be between 1 and 10. |
> | `size` | string | ❌ No | `auto` | `auto` `1024x1024` `1536x1024` `1024x1536` `2048x2048` `2048x1152` `3840x2160` `2160x3840` *or any valid custom size* | The size of the generated images. For gpt-image-1: one of auto, 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). Outputs exceeding 2560×1440 are considered experimental. |
> | `quality` | string | ❌ No | `auto` | `auto` `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. |
> | `background` | string | ❌ No | `auto` | `opaque` `auto` `transparent` | Allows to set transparency for the background of the generated image(s). `transparent` is only supported by gpt-image-1 (not gpt-image-2) and requires output\_format to be png or webp. When auto is used, the model will automatically determine the best background. |
> | `moderation` | string | ❌ No | `auto` | `low` `auto` | Content moderation level for generated images. `low` is less restrictive, `auto` is the default. |
> | `output_format` | string | ❌ No | `auto` | `auto` `png` `jpeg` `webp` | The output format of the generated image(s). Defaults to auto. jpeg is faster than png for latency-sensitive scenarios. |
> | `output_compression` | integer | ❌ No | `100` | `0-100` | The compression level (0-100%) for the output image. Only applicable with webp or jpeg format. Defaults to 100. |
> | `stream` | boolean | ❌ No | `false` | `true` `false` | Whether to stream the response in real-time. When enabled, partial images can be received during generation. |
> | `partial_images` | integer | ❌ No | - | `0-3` | The number of partial images to receive during streaming. Only used when stream is true. Each partial image incurs an additional 100 image output tokens. |
> | `user` | string | ❌ No | - | - | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. |

> [tab] Image Edit
>
> | Parameter | Type | Required | Default | Range | Description |
> | - | - | - | - | - | - |
> | `model` | string | ✅ Yes | `gpt-image-1` | `gpt-image-1` `gpt-image-1-mini` `gpt-image-1.5` `gpt-image-2` | The model to use for image editing. Defaults to gpt-image-1. |
> | `prompt` | string | ✅ Yes | - | 1–32000 chars | A text description of the desired image edit. |
> | `images` | file | ✅ Yes | - | max 16 images \< 50MB each | The input image(s) to edit. Each image should be a png, webp, or jpg file. You can provide up to 16 images. |
> | `mask` | file | ❌ No | - | - | An additional image whose fully transparent areas indicate where the image should be edited. |
> | `input_fidelity` | string | ❌ No | - | `high` `low` | Controls how faithfully the model preserves the original input image. Only supported by gpt-image-1. gpt-image-2 always uses high fidelity. |
> | `n` | integer | ❌ No | `1` | `1-10` | The number of images to generate. Must be between 1 and 10. |
> | `size` | string | ❌ No | `auto` | `auto` `1024x1024` `1536x1024` `1024x1536` `2048x2048` `2048x1152` `3840x2160` `2160x3840` *or any valid custom size* | The size of the generated images. For gpt-image-1: one of auto, 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). |
> | `quality` | string | ❌ No | `auto` | `auto` `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. |
> | `background` | string | ❌ No | `auto` | `opaque` `auto` `transparent` | Allows to set transparency for the background of the generated image(s). `transparent` is only supported by gpt-image-1 (not gpt-image-2) and requires output\_format to be png or webp. |
> | `moderation` | string | ❌ No | `auto` | `low` `auto` | Content moderation level for generated images. `low` is less restrictive, `auto` is the default. |
> | `output_format` | string | ❌ No | `auto` | `auto` `png` `jpeg` `webp` | The output format of the generated image(s). Defaults to auto. jpeg is faster than png for latency-sensitive scenarios. |
> | `output_compression` | integer | ❌ No | `100` | `0-100` | The compression level (0-100%) for the output image. Only applicable with webp or jpeg format. Defaults to 100. |
> | `stream` | boolean | ❌ No | `false` | `true` `false` | Whether to stream the response in real-time. When enabled, partial images can be received during generation. |
> | `partial_images` | integer | ❌ No | - | `0-3` | The number of partial images to receive during streaming. Only used when stream is true. Set to 0 for a single streaming event with the complete image. Each partial image incurs an additional 100 image output tokens. |
> | `user` | string | ❌ No | - | - | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. |

## Error Codes

### Common Error Codes

| Error Code | Error Name | Description |
| - | - | - |
| 401 | Unauthorized | API key is missing or invalid |
| 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation |
| 429 | Too Many Requests | You've exceeded your rate limit |
| 500 | Internal server error | An internal server error occurred |
| 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.