Back to blog
Abstract terminal setup dashboard for a Claude Code configuration guide

Claude Code Free Setup

Quick reference for setting up Claude Code with OpenCode's free API endpoint.

Author: Md. Rajib Hawlader

Guides9 min readUpdated 2026-05-13

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

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.

Prerequisites

RequirementWindowsMacLinux
Node.js 18+nodejs.orgnodejs.org or brew install nodeapt, yum, dnf, or pacman
Package Managerchoco install nodejsbrew install nodeSystem package manager

Installation

1. Install Node.js

Option A - Chocolatey:

choco install nodejs

Option B - Direct Download:

Download the installer from Node.js and run it.

2. Install Claude Code

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

3. Configure Settings

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"
  }
}

Environment Variables

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

Quick Commands

claude
Start interactive session
claude -p "prompt"
Run single prompt
claude --verbose
Enable verbose logging

Troubleshooting

Node not foundRestart terminal after installation or add Node.js to PATH.
Permission deniedUse sudo on Linux/Mac or run as administrator on Windows.
API errorsVerify your ANTHROPIC_BASE_URL is set to https://opencode.ai/zen.

Resources