1. GLM 模型
Maas 接口文档
  • 快速开始
  • GLM 模型
    • 文本生成
      POST
    • 图片理解
      POST
  • DeepSeek 模型
    • 文本生成
      POST
    • 图片理解
      POST
  • Qwen 模型
    • 文本生成
      POST
    • 图片理解
      POST
  • Kimi 模型
    • 文本生成
      POST
    • 图片理解
      POST
  • 火山引擎
    • OpenAI 兼容接口
      • doubao-seedance-2-0视频生成
      • doubao-seedance-2-0视频状态获取
      • doubao-seedance-2-0视频预览
    • 原生接口
      • doubao-seedance-2-0视频生成
      • doubao-seedance-2-0视频获取
  • claude code配置
    • 快速开始
    • 最佳实践
  • 龙虾系列配置
    • OpenClaw接入
    • NanoBot接入
  1. GLM 模型

图片理解

POST
/v1/chat/completions

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Header 参数

Body 参数application/json必填

示例
{
  "model": "glm-5.3-flash",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "这张图片是什么"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
          }
        }
      ]
    }
  ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "glm-5.3-flash",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "这张图片是什么"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
          }
        }
      ]
    }
  ]
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "id": "fd2345b8-2c71-4ff7-b8dc-3ac6b7235e1a",
    "created": 1790583010,
    "model": "glm-5.3-flash",
    "object": "chat.completion",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "message": {
                "content": "这是一张**猫(CAT)主题的标志设计图**,具体内容包括:\n\n## 图像元素\n\n1. **左侧图形**:一个抽象风格的猫形图标,采用极简设计手法:\n   - 顶部有两个尖尖的猫耳朵\n   - 身体呈流畅的曲线造型\n   - 底部有卷曲的尾巴\n   - 整体使用**蓝色到紫色/青色的渐变配色**,显得现代而时尚\n\n2. **右侧文字**:大写字母 \"**CAT**\"(英文“猫”的意思),使用了与图标相呼应的蓝紫色渐变效果,字体为简洁的无衬线字体\n\n## 整体风格\n\n- 背景为纯白色,突出主体\n- 设计风格**现代、简约、扁平化**\n- 渐变色调给人科技感和柔和的视觉体验\n\n这类标志通常可用于宠物品牌、科技产品、APP图标或创意工作室等场景。",
                "role": "assistant",
                "reasoning_content": "The user is asking in Chinese \"What is this image?\" - they want me to describe the image.\n\nThe image shows a logo design featuring:\n1. A stylized cat icon on the left - it's an abstract, minimalist cat silhouette made with gradient colors (blue to purple/cyan gradient). The cat shape includes pointed ears at top, a curved body, and what appears to be a tail curling at the bottom.\n2. The word \"CAT\" in capital letters on the right side, in a light blue/purple color with a gradient effect.\n\nThis appears to be a modern logo design, possibly for a brand or company named \"CAT\".",
                "provider_specific_fields": {
                    "reasoning_content": "The user is asking in Chinese \"What is this image?\" - they want me to describe the image.\n\nThe image shows a logo design featuring:\n1. A stylized cat icon on the left - it's an abstract, minimalist cat silhouette made with gradient colors (blue to purple/cyan gradient). The cat shape includes pointed ears at top, a curved body, and what appears to be a tail curling at the bottom.\n2. The word \"CAT\" in capital letters on the right side, in a light blue/purple color with a gradient effect.\n\nThis appears to be a modern logo design, possibly for a brand or company named \"CAT\"."
                }
            }
        }
    ],
    "usage": {
        "completion_tokens": 332,
        "prompt_tokens": 1637,
        "total_tokens": 1969,
        "completion_tokens_details": {
            "reasoning_tokens": 132,
            "text_tokens": 200
        },
        "prompt_tokens_details": {
            "cached_tokens": 0
        }
    }
}
修改于 2026-10-08 09:13:41
上一页
文本生成
下一页
文本生成
Built with