Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 932 Bytes

File metadata and controls

45 lines (32 loc) · 932 Bytes

Z2api Go

Proxy API for Z.ai compatible with OpenAI and Anthropic, written in Go.

Installation

Using Go

git clone https://github.com/Tylerx404/z2api-go.git
cd z2api-go
go mod download
go run main.go

Using Docker

git clone https://github.com/Tylerx404/z2api-go.git
cd z2api-go
docker-compose up -d

Configuration

Copy the .env.example file to .env and edit:

cp .env.example .env

Environment Variables

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-5

License

MIT License