> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat with Images

### Supported models

In the [model catalog](https://geekai.co/models), filter chat models by image recognition to see which ones can analyze images:

![Filtering chat models by image recognition](https://static.geekai.co/storage/2025/10/15/image-20251015212402629.png)

### One image

Send a chat request with one image:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-6.1-sol",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Extract the text from the image and return it as a list."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://static.geekai.co/storage/2025/03/08/1741444660440.jpg"
            }
          }
        ]
      }
    ]
}'
```

```bash python theme={null}
from openai import OpenAI

client = OpenAI(api_key="$GEEKAI_API_KEY", base_url="https://geekai.co/api/v1")

response = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What is in this image?"},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://static.geekai.co/storage/2025/03/08/1741444660440.jpg",
                },
            },
        ],
    }],
)

print(response.choices[0].message.content)
```

```bash javascript theme={null}
import OpenAI from "openai";

const openai = new OpenAI({
    baseURL: 'https://geekai.co/api/v1',
    apiKey: '$GEEKAI_API_KEY'
});

const response = await openai.chat.completions.create({
    model: "gpt-6.1-sol",
    messages: [{
        role: "user",
        content: [
            { type: "text", text: "What is in this image?" },
            {
                type: "image_url",
                image_url: {
                    url: "https://static.geekai.co/storage/2025/03/08/1741444660440.jpg",
                },
            },
        ],
    }],
});

console.log(response.choices[0].message.content);
```

```bash go theme={null}
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	requestBody := map[string]interface{}{
		"model": "gpt-6.1-sol",
		"messages": []interface{}{
      map[string]interface{}{
        "role": "user",
        "content": []interface{}{
          map[string]interface{}{
            "type": "text",
            "text": "What does this image contain?",
          },
          map[string]interface{}{
            "type": "image_url",
            "image_url": map[string]interface{}{
              "url": "https://static.geekai.co/logo/geekai-logo-main-tr.png",
            },
          },
        },
      },
    }
	}

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		panic(err)
	}

	client := &http.Client{}
	req, err := http.NewRequest("POST", "https://geekai.co/api/v1/chat/completions", bytes.NewBuffer(jsonData))
	if err != nil {
		panic(err)
	}

	req.Header.Set("Authorization", "Bearer $GEEKAI_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(body))
}
```

### Multiple images

To analyze multiple images, add one `image_url` object per image to the `content` list:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-6.1-sol",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Find the differences between the two images."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://static.geekai.co/storage/2025/05/14/image1.jpg"
            }
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://static.geekai.co/storage/2025/05/14/image2.jpg"
            }
          }
        ]
      }
    ]
}'
```

```bash python theme={null}
from openai import OpenAI

client = OpenAI(api_key="$GEEKAI_API_KEY", base_url="https://geekai.co/api/v1")

response = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Find the differences between the two images."},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://static.geekai.co/storage/2025/05/14/image1.jpg"
                }
            },
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://static.geekai.co/storage/2025/05/14/image2.jpg"
                }
            }
        ]
    }]
)

print(response.choices[0].message.content)
```

```bash javascript theme={null}
import OpenAI from "openai";

const openai = new OpenAI({
    baseURL: 'https://geekai.co/api/v1',
    apiKey: '$GEEKAI_API_KEY'
});

const response = await openai.chat.completions.create({
    model: "gpt-6.1-sol",
    messages: [{
        role: "user",
        content: [
            { type: "text", text: "Find the differences between the two images." },
            {
                type: "image_url",
                image_url: {
                    url: "https://static.geekai.co/storage/2025/05/14/image1.jpg"
                }
            },
            {
                type: "image_url",
                image_url: {
                    url: "https://static.geekai.co/storage/2025/05/14/image2.jpg"
                }
            }
        ]
    }]
});

console.log(response.choices[0].message.content);
```

```bash go theme={null}
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	requestBody := map[string]interface{}{
		"model": "gpt-6.1-sol",
		"messages": []interface{}{
			map[string]interface{}{
				"role": "user",
				"content": []interface{}{
					map[string]interface{}{
						"type": "text",
						"text": "Find the differences between the two images.",
					},
					map[string]interface{}{
						"type": "image_url",
						"image_url": map[string]interface{}{
							"url": "https://static.geekai.co/storage/2025/05/14/image1.jpg",
						},
					},
					map[string]interface{}{
						"type": "image_url",
						"image_url": map[string]interface{}{
							"url": "https://static.geekai.co/storage/2025/05/14/image2.jpg",
						},
					},
				},
			},
		},
	}

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		panic(err)
	}

	client := &http.Client{}
	req, err := http.NewRequest("POST", "https://geekai.co/api/v1/chat/completions", bytes.NewBuffer(jsonData))
	if err != nil {
		panic(err)
	}

	req.Header.Set("Authorization", "Bearer $GEEKAI_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(body))
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.