Step-by-Step

OpenClaw Setup Guide

Get your agent running efficiently from day one with the correct foundational configuration.

01

Installation

Start by pulling the latest version and installing dependencies. We recommend using Node.js v20+ for optimal performance.

# Clone the repository

git clone https://github.com/example/openclaw.git

cd openclaw

# Install dependencies

npm install

02

Basic Configuration

The magic happens in your openclaw.json file. Here is the recommended baseline config to prevent token bleed.

{
  "model": "claude-3-5-sonnet-latest",
  "temperature": 0.2, // Low temp for coding tasks
  "max_tokens": 4096,
  "tools": {
    "file_search": true,
    "terminal": true
  },
  "optimization": {
    "auto_reset_context_threshold": 30000
  }
}

Pro-tip: Choose Anthropic first for complex reasoning, but keep the temperature low (0.0 to 0.2) if you're writing code or analyzing data.

03

Add Your API Keys

Set up your environment variables. Never commit this file!

# .env

ANTHROPIC_API_KEY=sk-ant-api03...

OPENROUTER_API_KEY=sk-or-v1-... # Optional, for cheaper models

Want cheaper inference? Grab credits via our OpenRouter link to route easy tasks to cheaper models automatically.