Skip to content

Releases: D3-vin/Zcode2Api

Zcode2API v1.0.1 - Critical Stability Fixes

Choose a tag to compare

@D3-vin D3-vin released this 20 Sep 20:59

Zcode2API v1.0.1 - Critical Stability Fixes

Critical bug fixes for production stability: eliminated false failovers, captcha solver race conditions, and proxy routing issues.

🔥 Critical Fixes

  • Client abort no longer punishes accounts — disconnected clients (context canceled) used to trigger full proxy rotation cycle + risk strikes → 30-minute account freeze. Now exits immediately without penalties (internal/upstream/client.go, internal/gateway/forward.go)
  • Captcha solver serialized — parallel mints caused disk cache races and exit 1 storms. Now queued via semaphore (internal/captcha/nodesolver.go)
  • Honest logging — captcha mint logs now show "direct" instead of misleading proxy name (mints never use proxies)

✨ Improvements

  • Claude model aliases — route claude-opus-4-8, claude-sonnet-4-6GLM-5.3, claude-3-5-haiku-latestGLM-5.3-Flash (checked before catalog lookup)
  • Billing via round-robin proxy — billing requests now rotate through proxy pool instead of single sticky line (prevents "Not Enough Connections" on 46+ account scans)
  • Proxy re-seed on empty poolPROXY_FILE now re-populates profiles on empty DB or after Clear all (fixed self-deadlock in proxyMu)
  • Re-save JWT unfreezes accountSetToken now clears risk_strikes + cooling_until (intentional unfreeze)
  • Client version bump3.10.23.14.0 (both chat and billing)
  • Unified AppVersion — single source of truth in config.AppVersion (1.0.1), removed duplicates in main/gateway

📥 Downloads

Platform Download Size
Windows x64 zcode2api-windows-amd64.exe ~24.5 MB
Linux x64 zcode2api-linux-amd64 ~24.2 MB
macOS Intel zcode2api-macos-amd64 ~24.4 MB
macOS Apple Silicon zcode2api-macos-arm64 ~24.0 MB
Config template env.example 1 KB

🚀 Quick Start

# Download binary + env.example
# Rename and configure
mv env.example .env  # or: ren env.example .env (Windows)

# Run
./zcode2api-*

Dashboard: http://localhost:3101

📝 Changelog

Full Changelog: v1.0.0...v1.0.1


📖 Documentation

📱 Contact

Zcode2API v1.0.0 - Initial Release

Choose a tag to compare

@D3-vin D3-vin released this 15 Sep 10:18

Zcode2API v1.0.0 - Initial Release

OpenAI & Anthropic-compatible proxy for Z.AI with JWT account pool, automatic failover, captcha solving, and smart proxy rotation.

🚀 What's New

  • Dual Protocol Support — Anthropic Messages (/v1/messages) + OpenAI Chat (/v1/chat/completions) in one server
  • JWT Account Pool — automatic rotation with smart failover on quota exhaustion
  • Embedded Captcha Solver — integrated Node.js solver for Aliyun captchas (auto-extracts on first run)
  • Smart Proxy Management — sticky/rotate modes, auto-pause on failures, IP probing
  • Live Dashboard — web UI for account management, quota monitoring, proxy profiles
  • Dynamic Model Catalog — synced from account billing (currently GLM-5.3 & GLM-5.3-Flash)
  • Async Ticket API — SSE-based async endpoint for long-running requests
  • OAuth Integration — login to Z.AI directly from dashboard, auto-claim plans
  • Cross-Platform — Windows, macOS (Intel/ARM), Linux

📥 Downloads

Main Binary

Platform Download Size
Windows x64 zcode2api-windows-amd64.exe ~24.5 MB
Linux x64 zcode2api-linux-amd64 ~24.2 MB
macOS Intel zcode2api-macos-amd64 ~24.4 MB
macOS Apple Silicon zcode2api-macos-arm64 ~24.0 MB

🚀 Quick Start

# Download and extract
# Copy .env.example to .env and edit AUTH_TOKEN

# Run server
./zcode2api-*

# Dashboard: http://localhost:3101
# API: http://localhost:3101/v1/chat/completions

🔧 OpenAI Client Configuration (Cursor, OpenCode, etc.)

Base URL: http://localhost:3101/v1
API Key: d3vin  # your AUTH_TOKEN
Model: GLM-5.3

🔧 Anthropic Client Configuration (Claude Code)

Base URL: http://localhost:3101
API Key: d3vin  # your AUTH_TOKEN
Model: GLM-5.3

Works out of the box with streaming, function calling, and context management!

📝 Key Features

Account Management:

  • OAuth login to Z.AI from dashboard
  • Bulk JWT import (multi-line paste)
  • File import (tokens.txt)
  • Import from manager accounts.db (migrates device-ids & API keys)
  • Auto warm-up and plan claiming
  • Status tracking: Active/Standby/Cooling/Exhausted/Revoked/Expired/Disabled
  • Export/import pool with device identities (JSON)

Smart Failover:

  • Model exhaustion (429) → mark dead until quota reset, try next account
  • Load errors (3012/3007/3009/3010/529) → pause, rotate egress, fresh captcha
  • 429 with Retry-After → wait (capped at 120s) up to 5 retries
  • max_tokens clamped to 131072 (origin limit)

Proxy Management:

  • Sticky/rotate modes
  • Assign proxy to specific account (sticky egress)
  • Auto-pause after 2 probe failures
  • IP probing with configurable delay
  • Supported formats: http, https, socks5 (with/without auth)

Dashboard:

  • Web UI at http://localhost:3101
  • Real-time account quotas and status
  • Proxy profile management
  • Settings (change tokens on-the-fly, persists to DB)
  • Health monitoring

Requirements:

  • Node.js on PATH (for captcha solver)
  • Go 1.25+ (if building from source)

📖 Documentation

📱 Contact


⚠️ Disclaimer: This tool is for educational purposes. Ensure compliance with Z.AI Terms of Service.