Skip to content

GLM-ZAI-2API v1.0.0 - OpenAI Proxy for Z.AI

Choose a tag to compare

@D3-vin D3-vin released this 06 Jul 21:38

GLM-ZAI-2API v1.0.0

OpenAI-compatible proxy for Z.AI (GLM models) β€” single Go binary for all platforms.

πŸ”₯ Features

  • πŸš€ Single binary β€” server, captcha solver, and token store in one executable
  • πŸ”“ OpenAI-compatible β€” /v1/chat/completions and /v1/models endpoints
  • 🧩 Tool calling β€” full function calling support for Kiro and other IDEs
  • πŸ›‘οΈ In-process captcha β€” Aliyun Captcha V3 solver (no external dependencies)
  • πŸ“Š Embedded dashboard β€” live HTML status UI at http://localhost:5082
  • 🌐 Cross-platform β€” Windows, macOS (Intel/ARM), Linux
  • πŸ“¦ Standalone β€” pure-Go SQLite, zero CGO dependencies

πŸ’‘ Works with Kiro out of the box! Perfect for AI-assisted development.

πŸš€ Supported Models

  • glm-4.7 β€” works in guest mode (no token required)
  • GLM-5-Turbo β€” requires ZAI_TOKEN
  • GLM-5v-Turbo β€” requires ZAI_TOKEN (vision model)
  • GLM-5.1 β€” requires ZAI_TOKEN
  • glm-5.2 β€” requires ZAI_TOKEN (sometimes available)

πŸ“₯ Downloads

Main API Server

Platform Download Size
Windows x64 glm-zai-2api-windows-amd64.exe ~10.4 MB
Linux x64 glm-zai-2api-linux-amd64 ~10.2 MB
macOS Intel glm-zai-2api-macos-amd64 ~10.4 MB
macOS Apple Silicon glm-zai-2api-macos-arm64 ~9.8 MB

Token Collector

Platform Download Size
Windows x64 token-collector-windows-amd64.exe ~11.0 MB
Linux x64 token-collector-linux-amd64 ~10.8 MB
macOS Intel token-collector-macos-amd64 ~11.0 MB
macOS Apple Silicon token-collector-macos-arm64 ~10.4 MB

πŸ”§ Quick Start

1. Download

Download the appropriate binary for your platform from the assets below.

2. Collect Device Tokens

The captcha solver needs a pool of device tokens:

# Windows
.\token-collector-windows-amd64.exe --count 750 --out tokens.sqlite

# Linux/macOS
chmod +x ./token-collector-*
./token-collector-* --count 750 --out tokens.sqlite

3. Configure (Optional)

cp .env.example .env
# Edit .env to set ZAI_TOKEN for GLM-5 models

4. Run

# Windows
.\glm-zai-2api-windows-amd64.exe

# Linux/macOS
chmod +x ./glm-zai-2api-*
./glm-zai-2api-*

5. Access

πŸ”§ Kiro Configuration

Add as custom OpenAI endpoint in Kiro:

Base URL: http://localhost:5082/v1
API Key: d3vin
Model: glm-4.7 (guest) or GLM-5.1 (with token)

Full tool calling support works out of the box! πŸŽ‰

πŸ’‘ Getting ZAI_TOKEN (for GLM-5 models)

  1. Open https://chat.z.ai and log in
  2. DevTools (F12) β†’ Application β†’ Local Storage β†’ token
  3. Copy the value (starts with eyJ...)
  4. Add to .env: ZAI_TOKEN=eyJ...

πŸ“– Documentation

πŸ“± Contact

πŸ“ What's New in v1.0.0

Initial release with:

  • Complete OpenAI API compatibility
  • Tool calling adapter for function calling
  • In-process Aliyun Captcha V3 solver
  • Cross-platform builds for 4 platforms
  • Token collector utility
  • Embedded web dashboard
  • Session management with conversation history
  • Multiple model support (GLM-4.7 to GLM-5.2)

License: Provided as-is for educational and interoperability purposes.