cd /news/ai-tools/claude-code-free · home topics ai-tools article
[ARTICLE · art-14263] src=gist.github.com pub= topic=ai-tools verified=true sentiment=· neutral

claude-code-free

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.

read1 min publishedMay 14, 2026

Quick reference guide for setting up Claude Code with OpenCode

OpenCode is an AI-powered coding assistant CLI tool that helps with software engineering tasks. It uses various LLM providers including Anthropic Claude.

Website: https://opencode.ai/

Claude 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.

Product Page: https://claude.com/product/claude-code

  • Windows 10/11 Machine Running WSL2 Linux Ubuntu Machine
  • Node.js
  • OpenCode Zen account
sudo apt update
sudo apt install nodejs npm
sudo npm install -g @anthropic-ai/claude-code

Edit ~/.claude/settings.json

:

code ~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://opencode.ai/zen",
    "ANTHROPIC_MODEL": "minimax-m2.5-free",
    "ANTHROPIC_API_KEY": "opencode-api-key",
    "ENABLE_TOOL_SEARCH": "true"
  }
}
Variable Value Description
ANTHROPIC_BASE_URL
https://opencode.ai/zen
OpenCode API endpoint
ANTHROPIC_MODEL
minimax-m2.5-free
Model to use
ANTHROPIC_API_KEY
opencode-api-key
Your OpenCode API key
ENABLE_TOOL_SEARCH
true
Enable tool search feature
Command Description
claude -helps
To check available commands
claude -p "<prompt>"
Run single prompt
claude --version
To check current version

Download from https://nodejs.org/en/download and run the installer.

npm install -g @anthropic-ai/claude-code

Edit %USERPROFILE%\.claude\settings.json

:

code $env:USERPROFILE\.claude\settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://opencode.ai/zen",
    "ANTHROPIC_MODEL": "minimax-m2.5-free",
    "ANTHROPIC_API_KEY": "opencode-api-key",
    "ENABLE_TOOL_SEARCH": "true"
  }
}

Node not found: Restart terminal after installation or add Node.js to PATH** Permission denied**: Usesudo

on Linux or run as administrator on WindowsAPI errors: Verify yourANTHROPIC_BASE_URL

is correctly set tohttps://opencode.ai/zen

── more in #ai-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-free] indexed:0 read:1min 2026-05-14 ·