1. Conduid
  2. AI
  3. Z.ai2api
MCP server · AI

Z.ai2api

将 Z.ai Chat 代理为 OpenAI/Anthropic Compatible 格式,支持多模型列表映射、免令牌、智能处理思考链、图片上传等功能;Z.ai ZtoApi z2api ZaitoApi zai X-Signature 签名 GLM 4.5 v 4.6

72Good

Scored 5 months ago · breakdown

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.

The repository has 153 stars and 45 forks, with the last commit 12 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/hmjz100/Z.ai2api

This 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

I know everything about Z.ai2api. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 4 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

[!IMPORTANT] 正式版更新稍迟,如急需使用,建议切换到 Canary 分支。

功能

  • 支持根据官网 /api/models 生成模型列表,并自动选择合适的模型名称。
  • (登录后)支持上传图片,使用 GLM 识图系列模型。
  • 支持智能识别思考链,完美转换多种格式。

要求

.env

环境

使用 .env 文件进行配置。

BASE

  • 上游 API 基础域名
  • 默认值:https://chat.z.ai

PORT

  • 服务端口
  • 默认值:8080

MODEL

  • 备选模型,在未传入模型时调用
  • 默认值:GLM-4.5

TOKEN

  • 访问令牌
  • 如果启用了 ANONYMOUS_MODE 可不填

ANONYMOUS_MODE

  • 访客模式,启用后将获取随机令牌
  • 默认值:true
  • 访客模式下不支持上传文件调用视觉模型

THINK_TAGS_MODE

  • 思考链格式化模式
  • 默认值:reasoning
  • 可选 reasoning think strip details,效果如下
    • "reasoning"
      • reasoning_content: 嗯,用户……
      • content: 你好!
    • "think"
      • content: <think>\n\n嗯,用户……\n\n</think>\n\n你好!
    • "strip"
      • content: > 嗯,用户……\n\n你好!
    • "details"
      • content: <details type="reasoning" open><div>\n\n嗯,用户……\n\n</div><summary>Thought for 1 seconds</summary></details>\n\n你好!

DEBUG_MODE

  • 显示调试信息,启用后将显示一些调试信息
  • 默认值:false

使用

git clone https://github.com/hmjz100/Z.ai2api.git
cd Z.ai2api
pip install -r requirements.txt
python app.py

README fetched from the repository 4 days ago. The original is authoritative.

Questions

About Z.ai2api

How do I install Z.ai2api?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Z.ai2api safe to use with an AI agent?

Its trust score is 72 out of 100 (good). It passes 3 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Z.ai2api still maintained?

The last commit was 12 months ago and 1 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.