Skip to main content
POST
/
v1
/
images
/
generations
Create Image
curl --request POST \
  --url https://gptproto.com/v1/images/generations \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "prompt": "<string>",
  "n": 123,
  "size": "<string>"
}'
{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}

Overview

ImageGiven a prompt and/or input image, the model will generate a new image.Related Guides: Image GenerationCreate an image based on the prompt.

Authentication

This endpoint requires authentication using a Bearer token.
Authorization
string
required
Your API key in the format: Bearer YOUR_API_KEY

Request Body

model
string
required
The model to use for the request
prompt
string
required
Prompt parameter
n
integer
Number of completions to generate
size
string
Size parameter

Request Example

curl -X POST "https://gptproto.com/v1/images/generations" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-1",
  "prompt": "oxen and horses",
  "n": 1,
  "size": "1024x1024"
}'

Response

Success
200
Successful response
{
  "status": "success"
}

Error Responses

{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}