About Z.ai2api
Z.ai2api is an MCP server published by hmjz100 in the AI category: 将 Z.ai Chat 代理为 OpenAI/Anthropic Compatible 格式,支持多模型列表映射、免令牌、智能处理思考链、图片上传等功能;Z.ai ZtoApi z2api ZaitoApi zai X-Signature 签名 GLM 4.5 v 4.6. It has been installed 0 times through Conduid.
The repository has 126 stars and 41 forks, with the last commit 10 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.
Install
npx z-ai2apiThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Z.ai2api
Powered by Claude · Grounded in docs
Security checks
- ·README presentNot checked yet.
- ·License declaredNot checked yet.
- ·Tests presentNot checked yet.
- ·Dependencies pinnedNot checked yet.
- ·No dynamic code executionNot checked yet.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
[!IMPORTANT] 正式版更新稍迟,如急需使用,建议切换到 Canary 分支。
功能
- 支持根据官网 /api/models 生成模型列表,并自动选择合适的模型名称。
- (登录后)支持上传图片,使用 GLM 识图系列模型。
- 支持智能识别思考链,完美转换多种格式。
要求
环境
使用 .env 文件进行配置。
BASE
- 上游 API 基础域名
- 默认值:
https://chat.z.ai
PORT
- 服务端口
- 默认值:
8080
MODEL
- 备选模型,在未传入模型时调用
- 默认值:
GLM-4.5
TOKEN
- 访问令牌
- 如果启用了
ANONYMOUS_MODE可不填
ANONYMOUS_MODE
- 访客模式,启用后将获取随机令牌
- 默认值:
true - 访客模式下不支持上传文件调用视觉模型
THINK_TAGS_MODE
- 思考链格式化模式
- 默认值:
reasoning - 可选
reasoningthinkstripdetails,效果如下- "reasoning"
- reasoning_content:
嗯,用户…… - content:
你好!
- reasoning_content:
- "think"
- content:
<think>\n\n嗯,用户……\n\n</think>\n\n你好!
- content:
- "strip"
- content:
> 嗯,用户……\n\n你好!
- content:
- "details"
- content:
<details type="reasoning" open><div>\n\n嗯,用户……\n\n</div><summary>Thought for 1 seconds</summary></details>\n\n你好!
- content:
- "reasoning"
DEBUG_MODE
- 显示调试信息,启用后将显示一些调试信息
- 默认值:
false
使用
git clone https://github.com/hmjz100/Z.ai2api.git
cd Z.ai2api
pip install -r requirements.txt
python app.py
README mirrored from the source repository 4 months ago. The original is authoritative.