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
default:"sk-***********"
required
Your API key in the format: Bearer YOUR_API_KEY
Request Body
model
string
default:"gpt-image-1"
required
The model to use for the request
prompt
string
default:"oxen and horses"
required
Prompt parameter
Number of completions to generate
size
string
default:"1024x1024"
Size parameter
Request Example
curl -X POST "https://gptproto.com/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "oxen and horses",
"n": 1,
"size": "1024x1024"
}'
Response
Error Responses
{
"error": {
"message": "Invalid signature",
"type": "401"
}
}