Skip to main content
POST
/
v1
/
chat
/
completions
curl -X POST "https://gptproto.com/v1/chat/completions" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4.1",
  "messages": [
    {
      "role": "user",
      "content": "Who are you?"
    }
  ],
  "stream": false
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Overview

This endpoint provides text to text functionality.

Request Body

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgpt-4.1The model to use for the request
messagesarray✅ Yes-Array of message objects for the conversation
streamboolean❌ NotrueWhether to stream the response

Messages Array Structure

Each message object in the messages array should have the following structure:
FieldTypeRequiredDescription
rolestring✅ YesThe role of the message. Can be: user, assistant, or system
contentarray/string✅ YesThe content of the message

Content Array Structure (when content is an array)

FieldTypeRequiredExampleDescription
typestring✅ YestextThe type of content
textstring✅ Yes"The positive prompt for the generation."The text content when type is text
curl -X POST "https://gptproto.com/v1/chat/completions" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4.1",
  "messages": [
    {
      "role": "user",
      "content": "Who are you?"
    }
  ],
  "stream": false
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}