智谱 AI(GLM 系列)

目标

  • 完成智谱 AI 服务开通
  • 获取调用大模型服务的 API Key
项目 信息
官网 https://open.bigmodel.cn/
文档 https://docs.bigmodel.cn/cn/guide/start/quick-start
兼容格式 OpenAI 兼容
Base URL https://open.bigmodel.cn/api/paas/v4
代表模型 GLM-5.1、GLM-4.6V、GLM-5V-Turbo
新用户福利 免费赠送 2000 万 tokens 体验包

操作步骤

1. 注册账号

  • 访问 智谱开放平台
  • 点击右上角「注册/登录」,支持手机号注册和微信扫码登录
  • 完成注册后自动登录

📸 智谱开放平台首页,标注右上角「注册/登录」按钮位置

智谱-注册页面

2. 获取 API Key

  • 登录后进入 个人中心 → API Keys
  • 点击「创建新 API Key」
  • 复制并妥善保存生成的 Key(格式类似 xxxxxxxx.yyyyyyyyyy

📸 API Keys 管理页面,标注「创建新 API Key」按钮

智谱-创建API Key

📸 成功创建 API Key 后的复制弹窗(注意遮挡 Key 敏感部分)

智谱-复制API Key

3. 验证调用

curl -X POST "https://open.bigmodel.cn/api/paas/v4/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5.1",
    "messages": [
      {"role": "user", "content": "你好"}
    ]
  }'

results matching ""

    No results matching ""