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

# Claude 识图

> 基于 2026-03-23 Crazyrouter 生产环境验证的 Claude 图片理解

> 更新日期：2026-06-06

# Claude 识图

截至 2026 年 3 月 23 日，Crazyrouter 生产环境已验证两条 Claude 视觉输入路径：

* 原生 `POST /v1/messages` + `type: "image"` + Base64 PNG
* OpenAI 兼容 `POST /v1/chat/completions` + `type: "image_url"` + data URL

***

## 原生格式：`/v1/messages`

```bash theme={null}
curl https://api.crazyrouter.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 128,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "image",
            "source": {
              "type": "base64",
              "media_type": "image/png",
              "data": "iVBORw0KGgoAAA..."
            }
          },
          {
            "type": "text",
            "text": "What color is this image?"
          }
        ]
      }
    ]
  }'
```

本次生产环境检查返回了：

* `model: "claude-opus-4-8"`
* `content[0].type = "text"`

***

## OpenAI 兼容格式：`/v1/chat/completions`

```bash theme={null}
curl https://api.crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "What color is this image?"},
          {
            "type": "image_url",
            "image_url": {
              "url": "data:image/png;base64,iVBORw0KGgoAAA..."
            }
          }
        ]
      }
    ],
    "max_tokens": 128
  }'
```

2026-03-23 的生产环境实测里，模型返回的 `message.content` 是普通字符串，内容为对图片颜色的文本描述。

<Note>
  当前页面只保留 Base64 PNG / data URL 这两条已复测成功的视觉输入方式。远程 URL、更多图片格式与更复杂多图场景，本轮没有逐项复测。
</Note>
