Stop Paying Anthropic $200/Month for Claude Code

Stop Paying Anthropic $200/Month for Claude Code

How to Use Cheaper Models in Claude Code CLI

Introduction to Claude Code and Pricing

  • Claude Code is a powerful coding tool for both novice and experienced developers, but its pricing is considered high.
  • The video aims to demonstrate how to utilize more affordable models within the Claude Code CLI, maintaining access to all features at a significantly reduced cost.

Overview of ZAI's GLM4.7 Models

  • ZAI, a Chinese-based company, offers impressive models like GLM4.7 at much lower prices compared to competitors such as Claude Sonnet or Opus models.
  • According to the Code Arena leaderboard, GLM 4.7 is comparable in performance to Opus 4.5, although personal experience may vary.

Cost Comparison

  • ZAI's light package costs only $6 per month, providing three times the usage of Claude's pro plan priced at $20 per month.
  • Even ZAI’s max plan is only $30 per month compared to Claude's max plan which ranges from $100 to $200 monthly. This represents significant savings for users looking for alternatives.

Community Recommendations and Discounts

  • The speaker began exploring these models due to recommendations from their community and viewers who found them valuable for their price point.
  • A promotional offer allowed the speaker to sign up for just $3 per month initially; potential new users might find similar deals available now.

Developer Showcase Examples

  • Users have created impressive projects using these models, including a "Plants vs Zombies" clone that showcases sound effects and gameplay mechanics despite being in Chinese language content.

Integrating ZAI Models into Claude Code CLI

  • These models can be integrated into various environments including cursor code and open code alongside claude code itself, allowing flexibility in usage across platforms.

Setting Up Your Project with Settings.json

  • To use these models in your project, create a folder named 'cla' containing a settings.json file; if it doesn't exist yet, you can create it manually or download it from the community resources provided by the speaker.

Understanding Environment Object Usage

  • The environment object allows larger companies or enterprise clients to route inference calls through their infrastructure (e.g., AWS) instead of directly calling an API endpoint like Anthropic’s API endpoint; this ensures data security via unique API keys specific to organizations.

Routing Traffic Through Z AI

  • Instead of using traditional cloud providers’ APIs directly, users can route traffic through Z AI which has developed an anthropic wrapper mimicking expected behaviors while generating an API key from their service for integration purposes.

Mapping Models Between Providers

  • Users will need variables that map CLAUDE model names (like Sonnet) onto corresponding ZAI model names (like GLM4.7), ensuring compatibility between different systems during implementation processes.

For example:

  • Sonnet maps to GLM4.7
  • Haiku maps downwards to GLM4.5 air version instead of higher-tier options not supported by Z AI.

Scoping Settings: Project vs Global Level

  • Settings can be scoped either locally (project-specific) or globally (across all projects). For global settings on Windows:
  • Navigate user folder > Open 'cla' folder > Edit settings file accordingly.
  • This protects sensitive information like API keys when deploying projects publicly.

Configuring Local Project-Level Settings

  1. Create settings.local.json within your project directory.
  1. Copy necessary structures into this file while removing sensitive lines.
  1. Add .gitignore entry for settings.local.json so it's excluded from public repositories upon deployment.

This ensures secure handling of sensitive information during development cycles without exposing critical credentials online.

Obtaining Your API Key from Z AI

To finalize setup:

  1. Visit z.ai/subscribe and follow prompts after signing up.

2 . Choose subscription option then navigate under “API Keys” section where you can create new keys securely with designated names before utilizing them within your applications effectively!

How to Access GLM 4.7 Models in Claude Code

Setting Up the API Key

  • The process begins by confirming and copying the API key, which is then replaced in the necessary configuration. This allows access to the Z AI models, specifically GLM 4.7.

Running Claude Without Subscription

  • After setting up, running Claude initiates a setup process that should ideally be skipped due to an existing API key. However, a bug currently requires users to sign in again.

Bypassing Onboarding Steps

  • To avoid repeated onboarding steps, users can modify the cla.json file located in their user folder (for Windows). This involves changing a specific property related to onboarding completion.
  • Users need to add or modify a property called has_completed_onboarding, changing its value from false to true for seamless access without re-signing.

Accessing GLM Models

  • Once modifications are made, opening Claude will skip onboarding and provide access to GLM 4.7 models while still displaying Opus and Haiku in the model selector.
  • The GLM models offer significant cost savings compared to Claw models while retaining all functionalities of the Claw Code CLI, including sub-agents and custom commands.

Monitoring Usage

  • Users can track their current usage by visiting the API management screen where they created their API key; this includes checking subscription details under the usage tag.
Video description

🚀 Access ALL video resources & get personalized help in my community: https://www.skool.com/agentic-labs/about?ref=3fd61190e13d426dbf4f3b38adc7de69 🔗 Sign up to Z.AI: https://z.ai/subscribe?ic=FAOW6XG5LH 💬 My AI voice-to-text software (Wispr Flow): https://wisprflow.ai/r?WALTER67 ☕ Buy me a coffee: https://www.buymeacoffee.com/leonvanzyl 💵 Donate using PayPal: https://www.paypal.com/ncp/payment/EKRQ8QSGV6CWW Learn how to use cheaper AI models in Claude Code CLI with GLM 4.7 from ZAI. In this tutorial, you'll discover how to replace expensive Claude Sonnet and Opus models with ZAI's GLM 4.7 at a fraction of the cost. I'll show you how to configure your settings.json file, set up the API key, and route all inference calls through ZAI while keeping access to all Claude Code features like subagents, MCP servers, and custom commands. ⏰ TIMESTAMPS: 00:00 Claude Code pricing problem 00:25 GLM 4.7 models from ZAI 00:38 Cost comparison Claude vs ZAI 01:50 ZAI developer showcase 02:05 Using GLM 4.7 in Claude Code CLI 02:30 Settings.json configuration 03:05 Environment variables explained 04:15 Global vs project level settings 05:15 Settings.local.json for API key security 05:45 Gitignore setup 05:57 Getting your ZAI API key 06:34 Running Claude Code with GLM models 06:56 Skipping onboarding workaround 08:16 Claude Code features with ZAI models 09:00 Checking API usage #claudecode #agenticcoding #vibecoding