OpenClaw install guide (macOS)
0. Prerequisite: Node.js 24.16+ (OpenClaw needs 24.16+ or 26.1+; Node 22 won't work)
Install Node.js first: Node.js on macOS
Heads-up: OpenClaw is picky about Node versions. Make sure you're on Node.js 24.16+ (or 26.1+) before you continue.
1. Install OpenClaw
Step 1: Open Terminal (press Command + Space, type Terminal, press Enter).
Step 2: Paste this command into Terminal and press Enter:
curl -fsSL https://openclaw.ai/install.sh | bashStep 3: Check the install. Run these two commands:
openclaw --versionopenclaw doctorIf you see a version number and a health report, you're good.
2. Onboard
What's onboarding? Onboarding sets up OpenClaw as a background service on your machine, so you can use AI from the web panel or the command line.
Step 1: Run the onboarding command in Terminal:
openclaw onboard --install-daemonStep 2: Answer the prompts. If you're new, pick these:
Onboarding mode: choose
Manual- Use the ↑↓ arrow keys to move, Enter to confirm
What do you want to set up?: choose
Local gateway (this machine)- Runs the service on your own computer
Gateway port: enter
18789, or just press Enter for the default- The port the service listens on; no need to change it
Gateway auth: choose
Token- Recommended; it keeps your gateway locked down
3. Configure OpenClaw (connect to Flash API)
3.1 Where's the config file?
Config path: ~/.openclaw/openclaw.json
What that means:
~is your home directory- The full path is
/Users/<your-username>/.openclaw/openclaw.json
3.2 Get your Flash API key
Step 1: Grab your API key from Flash API
- No account yet? Sign up first
- After logging in, find your API key in the dashboard and copy it
Step 2: Pick a token for local gateway auth
- Anything works, e.g.
my-secret-token-123 - Remember it; you'll need it to open the gateway
3.3 Write the config file
Note: the commands below create the config file. Follow these steps:
Step 1: Create the config directory
mkdir -p ~/.openclawStep 2: Write the config file (replace two values)
cat > ~/.openclaw/openclaw.json <<'EOF'
{
"agents": {
"defaults": {
"model": {
"primary": "flashapi/gpt-6.1-sol"
}
}
},
"models": {
"mode": "merge",
"providers": {
"flashapi": {
"baseUrl": "https://ai.flashapi.top/v1",
"apiKey": "YOUR_FLASH_API_KEY",
"api": "openai-responses",
"models": [
{ "id": "gpt-6.1-sol", "name": "GPT-6.1 Sol" },
{ "id": "claude-opus-5-5", "name": "Claude Opus 5.5" },
{ "id": "gemini-2.5-pro", "name": "Gemini 2.5 Pro" }
]
}
}
},
"gateway": {
"mode": "local",
"port": 18789,
"auth": {
"mode": "token",
"token": "your-token"
}
}
}
EOFValues you must replace:
"apiKey": "YOUR_FLASH_API_KEY"→ replaceYOUR_FLASH_API_KEYwith the real key you copied from Flash API"token": "your-token"→ replaceyour-tokenwith your own token (e.g.my-secret-token-123)
How to do it:
- Copy the whole command above
- Replace the two placeholders with your real values
- Paste it into the terminal and run it
3.4 What the config does (optional reading)
Default model:
"primary": "flashapi/gpt-6.1-sol"makes GPT-6.1 Sol the default- To default to Claude, change it to
"primary": "flashapi/claude-opus-5-5" - To default to Gemini, change it to
"primary": "flashapi/gemini-2.5-pro"
Available models: The config registers three models you can switch between:
gpt-6.1-sol: GPT-6.1 Sol (OpenAI's latest)claude-opus-5-5: Claude Opus 5.5 (Anthropic)gemini-2.5-pro: Gemini 2.5 Pro (Google)
Key settings:
"baseUrl": the Flash API endpoint. Leave it as is."api": "openai-responses": OpenAI-compatible format. Leave it as is."port": 18789: the local gateway port. Must match what you chose during onboarding.
4. Restart the gateway and verify
Restart the OpenClaw gateway so it loads the new config.
Step 1: Restart the gateway
openclaw gateway restartStep 2: Check the config
openclaw doctorGreen ✓ marks mean you're set.
Step 3: Check the status
openclaw statusStep 4: Open the web dashboard
openclaw dashboardIt prints a URL (e.g. http://localhost:18789). Open it in your browser.
If it asks for a token:
- Enter the token you set in the config file (e.g.
my-secret-token-123) - You're in
5. Switching models
OpenClaw lets you switch models on the fly.
Option 1: from the web panel
- Open the URL printed by
openclaw dashboard - Find the model picker
- Pick a model (GPT-6.1 Sol, Claude Opus 5.5 or Gemini 2.5 Pro)
Option 2: change the default in the config file
- Open the config file
~/.openclaw/openclaw.jsonin a text editor - Find the
"primary"line - Set it to the model you want:
- GPT-6.1 Sol:
"primary": "flashapi/gpt-6.1-sol" - Claude Opus 5.5:
"primary": "flashapi/claude-opus-5-5" - Gemini 2.5 Pro:
"primary": "flashapi/gemini-2.5-pro"
- GPT-6.1 Sol:
- Save, then run
openclaw gateway restart
FAQ
1. "openclaw: command not found"
Cause: you haven't reopened the terminal since installing, or Node.js's global package path isn't on your PATH.
Fix:
- Close Terminal and open it again
- Still nothing? Restart your computer
- Still nothing? Check that Node.js is installed correctly:
node -v
2. Writing the config file fails
Cause: usually a permissions issue or a missing directory.
Fix:
- Create the directory manually:
mkdir -p ~/.openclaw - Run the config-writing command again
3. The gateway won't start
Cause: the port is taken, or the config file has a syntax error.
Fix:
- Check the config for syntax errors (especially quotes and commas)
- Make sure you replaced both the API key and the token
- Try a different port (e.g. 18790)
4. API calls fail
Cause: a wrong API key, or your Flash API balance has run out.
Fix:
- Check the key was copied correctly (no stray spaces)
- Log in to the dashboard and check your balance
- Make sure
baseUrlishttps://ai.flashapi.top/v1(note the trailing/v1)
Next steps
With everything configured, you can:
- Chat with AI in the web panel
- Call AI from the command line
- Integrate OpenClaw into your own projects
For more, see the official OpenClaw docs. Prefer zero manual steps? Try the OpenClaw one-line setup.