npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

codex-proxy

v2.1.0

Published

Format conversion proxy enabling Claude Code CLI to work with GLM-4.5-Air model including full tool calling support

Downloads

27

Readme

Claude Code Proxy - Claude Code to GLM-4.5-Air

A format conversion proxy server that enables using GLM-4.5-Air model with Claude Code CLI including full tool calling support.

What It Does

This proxy acts as a bridge between Claude Code and the GLM-4.5-Air model with format conversion:

  • ✅ Receives requests from Claude Code in Anthropic's Messages API format
  • ✅ Converts to OpenAI Chat Completions format
  • ✅ Forwards to GLM-4.5-Air API
  • ✅ Converts responses back to Anthropic format
  • Full tool calling support (Anthropic tool_use ↔ OpenAI tool_calls)
  • ✅ Handles both streaming and non-streaming responses
  • Comprehensive logging for debugging

Result: Use Claude Code with FREE GLM-4.5-Air model with full functionality!


Quick Start (NPM Installation)

3 simple steps to get started:

1. Install globally via npm

npm install -g claude-code-proxy

2. Start the proxy

claude-code-proxy              # Normal mode
claude-code-proxy --debug      # Debug mode (verbose logging)
claude-code-proxy --port 4000  # Custom port
claude-code-proxy --help       # Show all options

3. Configure Claude Code

In a new terminal:

export ANTHROPIC_AUTH_TOKEN="dummy"
export ANTHROPIC_BASE_URL="http://localhost:3333"
claude

That's it! Start using Claude Code with free Chutes GLM models.


Local Development Setup

  1. Install dependencies

    npm install
  2. Configure environment variables

    cp .env.example .env
    # Edit .env with your GLM-4.5-Air API credentials
  3. Start the proxy server

    Normal mode (minimal logging):

    npm run proxy

    Debug mode (verbose logging):

    npm run proxy:debug

Configure Claude Code

To use the proxy with Claude Code CLI:

Option 1: Using environment variables (Recommended)

export ANTHROPIC_AUTH_TOKEN="dummy"
export ANTHROPIC_BASE_URL="http://localhost:3333"
claude

Option 2: Update ~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "dummy",
    "ANTHROPIC_BASE_URL": "http://localhost:3333"
  }
}

Usage

  1. Start the proxy server (in one terminal):

    npm run proxy
    # or for debug mode with full logs:
    npm run proxy:debug
  2. Use Claude Code normally (in another terminal):

    export ANTHROPIC_AUTH_TOKEN="dummy"
    export ANTHROPIC_BASE_URL="http://localhost:3333"
    claude

    Claude Code will now use GLM-4.5-Air model with full tool calling support!

  3. To switch back to regular Claude:

    unset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL
    claude

Configuration

The proxy uses the following environment variables (in .env):

  • GLM_API_TOKEN: Your GLM-4.5-Air API token (required)
  • GLM_API_URL: GLM-4.5-Air API endpoint (default: https://llm.chutes.ai/v1/chat/completions)
  • GLM_MODEL: Model to use (default: zai-org/GLM-4.5-Air)
  • PORT: Proxy server port (default: 3333)

Features

Full tool calling support - Anthropic tool_use ↔ OpenAI tool_calls conversion ✅ Streaming responses - Real-time token-by-token output ✅ Comprehensive logging - Color-coded debug logs for troubleshooting ✅ Format conversion - Seamless Anthropic ↔ OpenAI translation ✅ Free GLM-4.5-Air API - Use GLM-4.5-Air at no cost ✅ Multiple models - Maps to Haiku, Sonnet, and Opus tiers ✅ TypeScript support - Full type definitions and IntelliSense support

Logging

The proxy provides color-coded logs for easy debugging:

  • 📥 Blue - Incoming requests from Claude Code
  • 🔄 Magenta - Format conversion operations
  • 📤 Cyan - Requests forwarded to Chutes API
  • Green - Successful operations
  • Red - Errors and failures
  • 🌊 Cyan - Streaming responses

Normal mode: Clean, minimal logs Debug mode: Full request/response bodies and conversion details

Documentation

  • RESEARCH.md - Complete research findings and solution approaches
  • TEST-RESULTS.md - GLM-4.5-Air API test results
  • TESTING-GUIDE.md - Comprehensive guide for testing and debugging the proxy
  • TYPESCRIPT.md - TypeScript usage guide and type definitions

Support

For issues or inquiries, contact: [email protected]

License

MIT