跳转到主要内容

聊天识图

POST /v1/chat/completions
截至 2026 年 3 月 23 日,Crazyrouter 生产环境已验证:
  • gpt-5.4 可以通过 OpenAI 风格的 image_url 输入读取图片
  • 使用 data:image/png;base64,... 形式的 data URL 可以成功返回文本答案
  • 当前返回的 message.content 是普通字符串,而不是多段内容数组

已验证的最小请求

curl https://crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "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": 100
  }'
2026-03-23 的生产环境实测里,gpt-5.4 返回:
{
  "model": "gpt-5.4",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Red."
      }
    }
  ]
}

当前建议

  • 新的视觉理解接入,优先使用 gpt-5.4
  • 当前主文档只保留已经复测成功的 data URL 输入方式
  • 远程 URL、多图输入、detail 参数等更复杂路径,本轮没有逐项复测,接入前请先做你自己的当日生产验证