Proxy API for Z.ai compatible with OpenAI and Anthropic, written in Go.
git clone https://github.com/vantaidinh04/z2api-go.git
cd z2api-go
go mod download
go run main.gogit clone https://github.com/vantaidinh04/z2api-go.git
cd z2api-go
docker-compose up -dCopy the .env.example file to .env and edit:
cp .env.example .env| Variable | Description | Default |
|---|---|---|
TOKEN |
Z.ai token (leave empty for anonymous mode, set for authenticated mode) | - |
PORT |
Server port | 8080 |
DEBUG |
Enable debug mode | false |
DEBUG_MSG |
Enable debug messages | false |
THINK_TAGS_MODE |
Thinking tags processing mode (reasoning, think, strip, details) |
reasoning |
MODEL |
Default model | glm-4.6 |
MIT License