From 1cdaba9c859ae60756ca076b20bc34123e9ec5e0 Mon Sep 17 00:00:00 2001 From: claude_dev Date: Mon, 29 Jun 2026 20:09:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0GLM-5.2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=B9=E6=A1=88=E8=B0=83=E7=A0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02-videotext-investigation-report.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/docs/design/02-videotext-investigation-report.md b/docs/design/02-videotext-investigation-report.md index 236a3e0..8c29ca5 100644 --- a/docs/design/02-videotext-investigation-report.md +++ b/docs/design/02-videotext-investigation-report.md @@ -318,4 +318,120 @@ Active backends: codex, gemini, claude --- +## 十一、GLM-5.2 配置方案(补充调研) + +### 11.1 智谱 AI GLM-5.2 概述 + +**模型信息**: +- 模型名称: `glm-5.2` +- 上下文长度: 1M token(100万) +- 发布时间: 2026-06-13 +- 特色: 长程 Coding Agent 场景优化 + +**OpenAI 兼容端点**: +```bash +base_url: https://api.zhipuai.cn/v1 +``` + +### 11.2 Codex CLI 配置 GLM-5.2 + +**方案一:通过 config.toml 配置** + +编辑 `~/.codex/config.toml`: +```toml +[profile.default] +openai_base_url = "https://api.zhipuai.cn/v1" +model = "glm-5.2" +``` + +设置 API Key: +```bash +export OPENAI_API_KEY="你的智谱API_Key" +``` + +**方案二:通过环境变量(更简单)** +```bash +export OPENAI_API_BASE="https://api.zhipuai.cn/v1" +export OPENAI_API_KEY="你的智谱API_Key" +``` + +**验证配置**: +```bash +codex --version +codex "测试" +``` + +### 11.3 Gemini CLI 配置 GLM-5.2 + +**根据智谱 AI 官方文档,需要使用定制版 Gemini CLI** + +#### 获取定制版本 + +```bash +git clone https://github.com/heartyguy/gemini-cli +cd gemini-cli +git checkout feature/openrouter-support +``` + +#### 环境配置 + +**配置 API 基础 URL**: +```bash +export OPENROUTER_BASE_URL="https://open.bigmodel.cn/api/coding/paas/v4" +``` + +**配置 API Key**: +```bash +export OPENROUTER_API_KEY="你的智谱API_Key" +``` + +#### 系统要求 + +- Node.js 版本 >= 18 + +#### 完整配置示例 + +```bash +# 1. 克隆定制版本 +git clone https://github.com/heartyguy/gemini-cli +cd gemini-cli +git checkout feature/openrouter-support + +# 2. 安装依赖 +npm install + +# 3. 设置环境变量 +export OPENROUTER_BASE_URL="https://open.bigmodel.cn/api/coding/paas/v4" +export OPENROUTER_API_KEY="你的智谱API_Key" + +# 4. 启动 +npm start +``` + +--- + +## 十二、配置总结 + +### 12.1 两个 CLI 都可以配置 GLM-5.2 + +| CLI | 配置方式 | Base URL | +|-----|---------|----------| +| **Codex CLI** | config.toml 或环境变量 | `https://api.zhipuai.cn/v1` | +| **Gemini CLI** | 定制版本 + 环境变量 | `https://open.bigmodel.cn/api/coding/paas/v4` | + +### 12.2 API Key 格式 + +智谱 AI 的 API Key 格式: +``` +xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx +``` + +### 12.3 模型名称 + +``` +glm-5.2 +``` + +--- + **报告结束**