> ## 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.

# 图片分析

以下是包含图片识别分析的 Response API 请求示例：

<CodeGroup>
  ```bash curl theme={null}
  curl --location --request POST 'https://geekai.co/api/v1/responses' \
  --header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
  --header 'Content-Type: application/json' \
  --data-raw '{
      "model": "gpt-5-mini",
      "input": [
        {
          "type": "message",
          "role": "user",
          "content": [
            {"type": "input_text", "text": "图片中包含什么内容?"},
            {
              "type": "input_image",
              "image_url": "https://static.geekai.co/logo/geekai-logo-main-tr.png"
            }
          ]
        }
      ]
  }'
  ```

  ```bash python theme={null}
  # 先安装 OpenAI SDK: `pip3 install openai`
  from openai import OpenAI
  client = OpenAI(api_key="$GEEKAI_API_KEY", base_url="https://geekai.co/api/v1")
  response = client.responses.create(
      model="gpt-5-mini",
      input=[
        {
          "type": "message",
          "role": "user",
          "content": [
            {"type": "input_text", "text": "图片中包含什么内容?"},
            {
              "type": "input_image",
              "image_url": "https://static.geekai.co/logo/geekai-logo-main-tr.png"
            }
          ]
        }
      ]   
  )
  print(response)
  ```

  ```bash javascript theme={null}
  // 先安装 OpenAI SDK: `npm install openai`
  import OpenAI from "openai";
  const openai = new OpenAI({
      baseURL: 'https://geekai.co/api/v1',
      apiKey: '$GEEKAI_API_KEY'
  });
  async function main() {
      const response = await openai.responses.create({
          model: "gpt-5-mini",
          input: [
            {
              type: "message",
              role: "user",
              content: [
                { type: "input_text", text: "图片中包含什么内容?" },
                {
                  type: "input_image",
                  image_url: "https://static.geekai.co/logo/geekai-logo-main-tr.png"
                }
              ]
            }
          ]
      });
      console.log(response);
  }
  main();
  ```

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

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

  func main() {
  	requestBody := map[string]any{
  		"model": "gpt-5-mini",
  		"input": []any{
              map[string]any{
                  "type": "message",
                  "role": "user",
                  "content": []any{
                      map[string]any{"type": "input_text", "text": "图片中包含什么内容?"},
                      map[string]any{
                          "type": "input_image",
                          "image_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/responses", 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))
  }
  ```
</CodeGroup>

多张图片识别传入多个图片对象到 content 列表即可：

```bash theme={null}
{
    "type": "message",
    "role": "user",
    "content": [
        {
            "type": "input_text", 
            "text": "找出两张图片中的不同点?"
        },
        {
            "type": "input_image",
            "image_url": "https://static.geekai.co/storage/2025/05/14/image1.jpg"
        },
        {
            "type": "input_image",
            "image_url": "https://static.geekai.co/storage/2025/05/14/image2.jpg"
        }
    ]
}
```
