Skip to main content
POST
/
v1
/
chat
/
completions
gpt-41-2025-04-14 (image analysis)
curl --request POST \
  --url https://api.example.com/v1/chat/completions
OpenAI’s official format(chat) for the image analysis API.
curl --location 'https://gptproto.com/v1/chat/completions' \
--header 'Authorization: sk-*****' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-41-2025-04-14",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "What is in this image?"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "data:image/jpeg;base64,${base64Image}"
                    }
                }
            ]
        }
    ],
    "stream": false
}'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699896916,
  "model": "gpt-41-2025-04-14",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows a wooden boardwalk path extending through a lush green grassland."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1250,
    "completion_tokens": 89,
    "total_tokens": 1339
  }
}

Request Body

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgpt-41-2025-04-14The model to use for the request. Must be a vision-enabled model.
messagesarray✅ Yes-Array of message objects with role and content
streamboolean❌ NofalseWhether to stream the response

Messages Array Structure

Each message object in the messages array should have the following structure:
FieldTypeRequiredDescription
rolestring✅ YesRole of the message sender. Can be: user or assistant
contentarray✅ YesArray of content objects (can include text and images)

Content Array Structure

Each content object in the content array should have the following structure:
FieldTypeRequiredDescription
typestring✅ YesType of content. Can be: text or image_url
textstring✅ Yes (if type is text)Text prompt content
image_urlobject✅ Yes (if type is image_url)Image URL object with url field containing image URL or base64 encoded image