Status: [UNTESTED] Endpoints found: http://localhost:8000/v1/chat/completions Source: https://github.com/Duy-Nguyen-2006/GLM-API # GLM-API Z.ai to OpenAI-Compatible API Proxy with Tool Calling Support. Convert Z.ai's free web chat into a fully OpenAI-compatible API endpoint, enabling coding agents like **Cline**, **Roo-Code**, and **OpenCode** to use GLM models with function/tool calling. ## Features - **OpenAI-Compatible API** - Drop-in replacement for OpenAI's `/v1/chat/completions` - **Tool Calling Support** - Emulated function calling via XML injection + multi-format parser - **CAPTCHA Bypass** - Playwright-based browser automation bypasses Aliyun invisible CAPTCHA - **Streaming Support** - SSE streaming responses (chunked) - **Thinking Models** - Supports reasoning_content for GLM thinking models - **Web Dashboard** - Monitor status and test API from browser - **Multiple Models** - GLM-4-Flash, GLM-4.5, GLM-5, GLM-5.1, and more ## Quick Start ### Prerequisites - Node.js 18+ - A Z.ai account (free at [chat.z.ai](https://chat.z.ai)) ### Setup 1. Clone and install: ```bash git clone https://github.com/toan9tranphu/GLM-API.git cd GLM-API npm install npx playwright install chromium ``` 2. Get your Z.ai JWT token: - Log in to [chat.z.ai](https://chat.z.ai) - Open browser DevTools → Application → Cookies → `token` - Copy the JWT value 3. Start the server: ```bash ZAI_TOKEN=your_jwt_token_here API_KEY=sk-your-key node server.js ``` ### Configure Cline In Cline settings: - **API Provider**: OpenAI Compatible - **Base URL**: `http://localhost:8000/v1` - **API Key**: `sk-your-key` (same as `API_KEY` env var) - **Model**: `glm-4-flash` (or any supported model) ## API Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/health` | Health check (no auth) | | GET | `/v1/models` | List available models | | POST | `/v1/chat/completions` | Chat completion (OpenAI format) | | GET | `/` | Web dashboard | ## Supported Models - `glm-4-flash` (fastest, free) - `glm-4.5`, `glm-4.5-air` - `glm-4.6`, `glm-4.6-v` - `glm-4.7` - `glm-5`, `glm-5-tu