Skip to main content
POST
/
v1
/
chat
/
completions
Image Analysis
curl --request POST \
  --url https://gptproto.com/v1/chat/completions \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "messages": [
    {}
  ],
  "stream": true
}'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699896916,
  "model": "gpt-5-nano",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows a wooden boardwalk path extending through a lush green grassland. The boardwalk appears to lead toward a distant tree line under a bright blue sky with some clouds. The grass on either side of the boardwalk is vibrant green, suggesting it might be spring or summer. The scene has a peaceful, natural atmosphere with good visibility and sunny weather conditions."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1250,
    "completion_tokens": 89,
    "total_tokens": 1339
  }
}

Overview

This endpoint provides image analysis functionality using the OpenAI-compatible chat completions API. Upload images or provide image URLs to analyze and understand image content with vision-enabled models.

Authentication

This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: sk-*****

Request Body

model
string
default:"gpt-5-nano"
required
The model to use for the request. Must be a vision-enabled model.
messages
array
required
Array of message objects for the conversation. Each message contains:
  • role: “user” or “assistant”
  • content: Can be a string or an array of content objects supporting:
    • text: Text content with type: "text" and text field
    • image_url: Image content with type: "image_url" and nested image_url object containing:
      • url: HTTP/HTTPS URL to the image
      • Supported formats: JPG, PNG, WebP, GIF
stream
boolean
default:false
Whether to stream the response

Request Example

curl -X POST "https://gptproto.com/v1/chat/completions" \
  -H "Authorization: sk-*****" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-nano",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "What is in this image?"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
          }
        }
      ]
    }
  ],
}'

Response

id
string
Unique identifier for the chat completion
object
string
Object type, always “chat.completion”
created
integer
Unix timestamp of when the chat completion was created
model
string
The model used for generating the completion
choices
array
Array of completion choices
usage
object
Token usage statistics
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699896916,
  "model": "gpt-5-nano",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows a wooden boardwalk path extending through a lush green grassland. The boardwalk appears to lead toward a distant tree line under a bright blue sky with some clouds. The grass on either side of the boardwalk is vibrant green, suggesting it might be spring or summer. The scene has a peaceful, natural atmosphere with good visibility and sunny weather conditions."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1250,
    "completion_tokens": 89,
    "total_tokens": 1339
  }
}