Your First OpenClaw Agent
Create, configure, and deploy your own AI agent using OpenClaw. You'll build a fully functional agent that can perform real tasks — and publish it to the web with Cloudflare Pages. No coding background needed.
To follow the workshop, you need an API key for an AI model provider. The cheapest option is DeepSeek directly (platform.deepseek.com) — pennies per session. But you can use OpenAI, Anthropic (Claude), OpenRouter, or any other provider OpenClaw supports. Step 02 below covers how to configure your key — pick whichever provider works best for you.
We won't have time to troubleshoot installations during the session. This takes roughly 10 minutes. Complete it in advance so you can start building from minute one.
First time using Terminal?
Terminal (Mac) and PowerShell (Windows) are just text-based ways to give your computer instructions. Instead of clicking icons, you type commands and press Enter. Don't worry — we'll tell you exactly what to type.
On a Mac
- 1. Press ⌘ Command + Space — this opens Spotlight Search
- 2. Type Terminal and press Return (Enter)
- 3. A dark window appears — that's Terminal! ✅
On Windows
- 1. Press Win + R — this opens the Run dialog
- 2. Type powershell and press Enter
- 3. A blue window appears — that's PowerShell! ✅
1. Click the "Copy" button next to any command — it copies the text automatically.
2. Go to Terminal / PowerShell and right-click → Paste (or press Ctrl+V on Windows / ⌘+V on Mac).
3. Press Enter / Return — the command runs and shows you the result.
Every box with a dark background is a command — an instruction you give to your computer. We've added short explanations underneath each one so you always know what's happening. If something goes wrong, the error message usually tells you what's missing.
Install Python 3
The scanner we'll build runs on Python 3. Most computers already have it — check once, and if it's there, skip this step entirely.
-
1
Check if Python is already installed:
Terminal · macOSpython3 --version
If you see Python 3.x.x — you're done.
-
2
If not installed — go to python.org/downloads and click the big yellow Download Python 3.x.x button. Open the downloaded file and click through the installer.
-
1
Check if Python is already installed:
PowerShell · Windowspython --version
If you see Python 3.x.x — you're done.
-
2
If not installed — the fastest way is one command in PowerShell:
PowerShell · Windowswinget install Python.Python.3
Or go to python.org/downloads, download the installer, and run it. Important: on the first installer screen, tick "Add Python to PATH" before clicking Install.
Install OpenClaw
OpenClaw is the tool we'll use throughout the session. Select your OS below and run the command in your terminal.
docs.openclaw.ai/install-
1
Open Terminal — see how below if you're not sure
-
2
Paste and run this command:
Terminal · macOScurl -fsSL https://openclaw.ai/install.sh | bash
Official installer — detects your OS, installs Node if needed, installs OpenClaw, and launches the setup wizard.
-
3
Follow the on-screen prompts to finish the wizard.
How to open Terminal macOS
- Press ⌘ Command + Space to open Spotlight Search
- Type
Terminaland press Return - Click the Copy button on the command above — then right-click → Paste into Terminal (or press ⌘+V)
- Press Return to run it
If you have Claude Code, GitHub Copilot, or GitHub Codex — paste the install command directly and ask it to guide you through setup. Say: "Help me run this OpenClaw install command."
-
1
Open PowerShell — see how below
-
2
Paste and run this command:
PowerShell · Windows& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1)))
Official Windows installer. PowerShell works well; WSL2 also supported for extra stability.
-
3
Follow the on-screen prompts to finish the wizard.
Windows blocks scripts by default. If you see an error like:
SecurityException : The term 'SecurityException' is not recognized...
You're hitting a PowerShell execution policy block. Run this command first to allow scripts, then retry the install:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
If that still fails, use this temporary bypass instead:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
How to open PowerShell Windows
- Press Win + R to open the Run dialog
- Type
powershelland press Enter - Click the Copy button on the command above — then right-click → Paste into PowerShell (or press Ctrl+V)
- Press Enter to run it
If you have Claude Code, GitHub Copilot, or GitHub Codex — paste the install command directly and ask it to guide you through setup. Say: "Help me run this OpenClaw install command."
The wizard will ask about channels (Telegram, WhatsApp, Signal, etc.), skills, and other extras. You can safely skip everything for now — just choose "Skip for now" on each screen. For the workshop, we'll be using the built-in Web UI, which doesn't need any of this. Everything can be added later.
When asked "How do you want to hatch your agent?", choose "Hatch in Browser". This opens the chat in your web browser — exactly what we need for the workshop.
Configure OpenRouter
OpenClaw uses OpenRouter to access AI models. Connect your API key — most models have free tiers, paid ones cost pennies per session.
docs.openclaw.ai — OpenRouter provider openrouter.ai — OpenClaw integration guideThe onboard command walks you through the entire OpenRouter setup interactively. Recommended if this is your first time.
openclaw onboard
When you see the prompt ◆ Model/auth provider, choose More, then select OpenRouter from the list and press Enter. Paste your OpenRouter API key (begins with sk-or-...). If you don't have one, sign up at openrouter.ai/keys.
Already have your OpenRouter key? Run this single command — replace the key with yours:
openclaw onboard --auth-choice apiKey --token-provider openrouter --token "sk-or-v1-your-key-here"
Replace sk-or-v1-your-key-here with your actual key.
Or set the key directly without the wizard:
- 1
Open Terminal (same as Step 1)
-
2
Set your OpenRouter key:
Terminal · macOSopenclaw config set models.providers.openrouter.apiKey "YOUR_OPENROUTER_KEY"
Replace YOUR_OPENROUTER_KEY with your key from openrouter.ai/keys (begins with sk-or-...).
-
3
Verify the key was saved:
Terminal · macOSopenclaw models auth listYou should see openrouter:default listed as a configured provider.
Or set the key directly without the wizard:
- 1
Open PowerShell (same as Step 1)
-
2
Set your OpenRouter key:
PowerShell · Windowsopenclaw config set models.providers.openrouter.apiKey "YOUR_OPENROUTER_KEY"
Replace YOUR_OPENROUTER_KEY with your key from openrouter.ai/keys (begins with sk-or-...).
-
3
Verify the key was saved:
PowerShell · Windowsopenclaw models auth listYou should see openrouter:default listed as a configured provider.
Launch & Verify
Start OpenClaw and confirm your agent responds to your messages.
openclaw dashboard
This opens the Web UI at http://127.0.0.1:18789. Send a test message: "Hello! What model are you running?"
If your agent responds — your setup is complete! ✅
No response in the chat?
Run the doctor:
openclaw doctor --fix
Still stuck? Restart and retry:
openclaw doctor --fix && openclaw gateway restart
If you see "Device pairing required" in the browser, copy the device code and run:
openclaw devices approve YOUR-DEVICE-CODE
Then reconnect in the browser.
Run the doctor command — it detects common issues and can fix them automatically:
openclaw doctor --fix
Also check that openclaw models auth list shows openrouter:default, and that the model name is spelled exactly as shown above — including the openrouter/ prefix.
Restart OpenClaw and try the doctor — most issues clear up after a restart:
openclaw gateway restart
If the problem still doesn't go away, run the doctor with auto-fix and restart again:
openclaw doctor --fix && openclaw gateway restart
Prepare Cloudflare Pages
We'll be deploying to Cloudflare Pages during the workshop. Get your account ready beforehand.
Create a Cloudflare account
Go to dash.cloudflare.com/sign-up and create a free account. No credit card required — the Pages free tier is genuinely free.
Install Wrangler CLI
Wrangler is Cloudflare's CLI for deploying to Pages. Node.js was installed automatically with OpenClaw, so npm is already available.
npm install -g wrangler
Authenticate
npx wrangler login
Your browser opens to authenticate with Cloudflare. Verify it worked:
npx wrangler whoami
If it shows your Cloudflare account email — you're authenticated and ready for the workshop.
Run npx wrangler --version to check. If you see a version, just make sure you're logged in with npx wrangler login.
Before wrapping up, make sure your agent responds in the Web UI:
openclaw dashboard
Send a test message: "Hello! What model are you running?"
If your agent responds — your setup is complete! ✅
Confirm all six before Tuesday, May 26:
python3 --version (macOS) or python --version (Windows) prints a version number
openclaw --version prints a version number
openclaw models auth list shows openrouter:default
npx wrangler whoami shows your email
Check the OpenClaw FAQ for common installation issues.
💬 Still stuck? Leave a comment on the AI Realist Live Workshop post — I'll help you out.
⚠️ Stuck on opening Terminal? See the ✨ First time using Terminal? section above for step-by-step instructions.
Getting the Most from OpenClaw
Practical advice — model selection, performance tuning, and routing strategies.
Use DeepSeek V4 Directly
Configure DeepSeek as a direct provider — faster, cheaper, and fewer rate limits than routing through OpenRouter.
Configuration
openclaw config set models.providers.deepseek.apiKey "sk-your-key-here" openclaw config set models.providers.deepseek.baseUrl "https://api.deepseek.com/v1"
Usage
# Use the model directly (no routing) openclaw chat --model deepseek/deepseek-v4-flash # In gateway/webchat — prefix with provider name: # deepseek/deepseek-chat # deepseek/deepseek-reasoner
Lower latency (no routing hop), fewer outages (independent of OpenRouter), full context window, and support for token tracking.
Switch Off Thinking
Thinking mode is great for complex reasoning but wasteful for simple tasks. Control it per-session.
# In TUI / CLI: openclaw chat --thinking off # In isolated tasks (cron): # Set payload.thinking to "disabled" or omit it
| Mode | Best For | Avoid When |
|---|---|---|
| On | Complex reasoning, debugging, multi-step analysis, quality review | Simple Q&A, formatting, boilerplate tasks |
| Off | Fast Q&A, file operations, routine cron tasks | Deep logical reasoning, multi-step validation |
If the task can be done in one or two sentences — thinking off. If it needs analysis, comparison, or planning — keep it on.
Use Models Directly from Provider
OpenRouter is great for exploration. For production — go direct to the provider.
# DeepSeek openclaw config set models.providers.deepseek.apiKey "sk-..." openclaw config set models.providers.deepseek.baseUrl "https://api.deepseek.com/v1" # Google / Gemini openclaw config set models.providers.google.apiKey "..." # OpenAI openclaw config set models.providers.openai.apiKey "sk-..." # Anthropic / Claude openclaw config set models.providers.anthropic.apiKey "sk-ant-..."
| Aspect | OpenRouter | Direct Provider |
|---|---|---|
| Latency | +50–200ms routing overhead | Direct, no hop |
| Rate limits | Shared pool | Your own quota |
| Provider features | Limited (no streaming metadata, limited tool-calling) | Full API surface |
| Pricing | Small markup | Direct rates |
| Discovery | ✅ One key for many models | ❌ One key per provider |
Use OpenRouter for exploration (testing models, comparing outputs) and direct providers for production (daily workflow, cron jobs, agents). Configure both and switch with --model provider/model-name.
Default Models & Fallbacks
Configure OpenClaw to use specific models by default and fall back gracefully when a provider is down.
# Set the default model for all agents openclaw config set agents.defaults.model "deepseek/deepseek-v4-flash" # Configure fallback chain openclaw config set agents.defaults.fallbacks '["deepseek/deepseek-chat", "openai/gpt-4o"]' # Force per-agent override openclaw agents update your-agent --model deepseek/deepseek-v4-pro --thinking high