{"slug": "claude-code-free", "title": "claude-code-free", "summary": "A developer has published a guide for configuring Anthropic's Claude Code CLI tool to use OpenCode's free API endpoint instead of Anthropic's direct API. The setup requires editing the `~/.claude/settings.json` file to point `ANTHROPIC_BASE_URL` to `https://opencode.ai/zen` and setting the model to `minimax-m2.5-free`. The configuration works on both Linux via WSL2 and Windows systems with Node.js installed.", "body_md": "Quick reference guide for setting up Claude Code with OpenCode\n\nOpenCode is an AI-powered coding assistant CLI tool that helps with software engineering tasks. It uses various LLM providers including Anthropic Claude.\n\n**Website**: [https://opencode.ai/](https://opencode.ai/)\n\nClaude Code is Anthropic's official CLI tool for interacting with Claude AI. It can be configured to use OpenCode's free API endpoint instead of Anthropic's direct API.\n\n**Product Page**: [https://claude.com/product/claude-code](https://claude.com/product/claude-code)\n\n- Windows 10/11 Machine Running WSL2 Linux Ubuntu Machine\n- Node.js\n- OpenCode Zen account\n\n```\nsudo apt update\nsudo apt install nodejs npm\nsudo npm install -g @anthropic-ai/claude-code\n```\n\nEdit `~/.claude/settings.json`\n\n:\n\n```\ncode ~/.claude/settings.json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"https://opencode.ai/zen\",\n    \"ANTHROPIC_MODEL\": \"minimax-m2.5-free\",\n    \"ANTHROPIC_API_KEY\": \"opencode-api-key\",\n    \"ENABLE_TOOL_SEARCH\": \"true\"\n  }\n}\n```\n\n| Variable | Value | Description |\n|---|---|---|\n`ANTHROPIC_BASE_URL` |\n`https://opencode.ai/zen` |\nOpenCode API endpoint |\n`ANTHROPIC_MODEL` |\n`minimax-m2.5-free` |\nModel to use |\n`ANTHROPIC_API_KEY` |\n`opencode-api-key` |\nYour OpenCode API key |\n`ENABLE_TOOL_SEARCH` |\n`true` |\nEnable tool search feature |\n\n| Command | Description |\n|---|---|\n`claude -helps` |\nTo check available commands |\n`claude -p \"<prompt>\"` |\nRun single prompt |\n`claude --version` |\nTo check current version |\n\nDownload from [https://nodejs.org/en/download](https://nodejs.org/en/download) and run the installer.\n\n```\nnpm install -g @anthropic-ai/claude-code\n```\n\nEdit `%USERPROFILE%\\.claude\\settings.json`\n\n:\n\n```\ncode $env:USERPROFILE\\.claude\\settings.json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"https://opencode.ai/zen\",\n    \"ANTHROPIC_MODEL\": \"minimax-m2.5-free\",\n    \"ANTHROPIC_API_KEY\": \"opencode-api-key\",\n    \"ENABLE_TOOL_SEARCH\": \"true\"\n  }\n}\n```\n\n**Node not found**: Restart terminal after installation or add Node.js to PATH** Permission denied**: Use`sudo`\n\non Linux or run as administrator on Windows**API errors**: Verify your`ANTHROPIC_BASE_URL`\n\nis correctly set to`https://opencode.ai/zen`\n\n- OpenCode Website:\n[https://opencode.ai/](https://opencode.ai/) - Claude Code:\n[https://claude.com/product/claude-code](https://claude.com/product/claude-code) - Node.js Downloads:\n[https://nodejs.org/en/download](https://nodejs.org/en/download)", "url": "https://wpnews.pro/news/claude-code-free", "canonical_source": "https://gist.github.com/simrotion13/37b329da1372368328c80b753ed65b8b", "published_at": "2026-05-14 19:06:39+00:00", "updated_at": "2026-05-26 09:34:58.569264+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "artificial-intelligence"], "entities": ["Claude Code", "OpenCode", "Anthropic", "Claude AI", "Node.js", "WSL2", "Ubuntu", "minimax-m2.5-free"], "alternates": {"html": "https://wpnews.pro/news/claude-code-free", "markdown": "https://wpnews.pro/news/claude-code-free.md", "text": "https://wpnews.pro/news/claude-code-free.txt", "jsonld": "https://wpnews.pro/news/claude-code-free.jsonld"}}