JUHE API Marketplace

How to Use GLM-4.5 API in Claude Code

4 min read

1 Overview

Claude Code, Anthropic’s terminal-based coding assistant, allows developers to integrate custom large language models by editing a local configuration file. This flexibility means you can connect alternative LLMs—such as GLM 4.5 from Wisdom Gate—to power your workflow directly inside Claude Code.

By redirecting Claude Code’s API endpoint and authentication variables, you can make it use Wisdom Gate’s GLM-4.5 API as if it were the default Claude backend.


2 Why Use GLM 4.5 from Wisdom Gate

GLM 4.5 is an advanced reasoning and code-generation model optimized for cost-efficiency and fast inference. Running it through Wisdom Gate offers:

  • ⚡ OpenAI-compatible API structure (no SDK needed)
  • 💡 Stable infrastructure and global low-latency routing
  • 💰 Lower per-token costs compared to official LLM providers
  • 🧩 Instant integration with Claude Code’s config system

3 Prerequisites

Before starting, make sure you have:

  1. Claude Code installed (macOS or Linux)
  2. A Wisdom Gate developer account: https://wisdom-gate.juheapi.com
  3. An API key from your dashboard → Console → Applications
  4. Basic familiarity with JSON and environment variables

4 Step-by-Step Configuration

4.1 Create the Configuration Directory

mkdir -p ~/.claude

4.2 Edit the Settings File

nano ~/.claude/settings.json

4.3 Add the Configuration Below

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your_wisdom_gate_api_key",
    "ANTHROPIC_BASE_URL": "https://wisdom-gate.juheapi.com/",
    "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "32000"
  },
  "permissions": {
    "allow": ["Read", "Write", "Execute"],
    "deny": []
  },
  "model": "wisdom-ai-glm4.5"
}

4.4 Explanation of Parameters

  • ANTHROPIC_AUTH_TOKEN – Your Wisdom Gate API key (acts as the Claude auth token)
  • ANTHROPIC_BASE_URL – The Wisdom Gate endpoint replacing Anthropic’s default
  • CLAUDE_CODE_MAX_OUTPUT_TOKENS – Maximum output token length per response
  • model – Specifies the exact Wisdom Gate model ID: wisdom-ai-glm4.5
  • permissions – Controls Claude Code’s read/write/execute privileges

5 Testing the Integration

  1. Restart Claude Code.
  2. Run a simple prompt (e.g., “Write a Python function to reverse a string”).
  3. Observe API activity in your terminal; responses should now come from wisdom-gate.juheapi.com.
  4. Verify token usage in the Wisdom Gate Logs.

6 Performance and Pricing Notes

GLM 4.6 is positioned as a balanced model for technical reasoning and code tasks. Through Wisdom Gate, it runs with low latency and a fraction of the cost of comparable Claude or GPT-4 models.

FeatureClaude Code (default)GLM 4.5 via Wisdom Gate
Model FamilyClaude 3 / OpusGLM 4.5
Pricing≈ $10 / 1M output tokens≈ $2.1 / 1M output tokens
SpeedMediumFast
AvailabilityUS serversGlobal edge nodes

7 Security and Best Practices

  • Never commit API keys to source control.

  • Set file permissions:

    chmod 600 ~/.claude/settings.json  
    
  • Rate limit client calls if looping requests.

  • Monitor usage and balance in the Billing Console.


8 Troubleshooting

IssueLikely CauseFix
“Unauthorized” errorWrong API keyRe-check token from Wisdom Gate dashboard
Timeout errorsNetwork firewall or DNS latencyTry VPN or Asia/EU edge endpoint
No responseModel name mismatchEnsure model = wisdom-ai-glm4.5

9 Advanced Configuration

  • Run multiple models by switching the model field (e.g., claude-sonnet-4-5-20250929).
  • Adjust CLAUDE_CODE_MAX_OUTPUT_TOKENS for longer generation.
  • Use custom proxies if you need to route traffic locally through MCP servers.

10 Use Cases

  • Code completion and refactoring
  • API integration mockups
  • Automated comment generation
  • Complex logic generation in multi-language projects

11 Conclusion

Connecting Claude Code to Wisdom Gate’s GLM 4.5 API unlocks a powerful, cost-efficient workflow for developers. With just one configuration file, you gain access to a state-of-the-art model that matches Claude’s developer experience while offering faster responses and lower costs.

Try it today: https://wisdom-gate.juheapi.com/models/wisdom-ai-glm4.5


Appendix A – Quick Reference

SettingValue
Base URLhttps://wisdom-gate.juheapi.com/v1
Model Namewisdom-ai-glm4.5
Config File~/.claude/settings.json
Docshttps://wisdom-gate.juheapi.com/docs