OpenClaw Quick Start: Build Your First AI Agent in 5 Minutes
This guide shows how to build your first AI Agent with OpenClaw in 5 minutes, covering installation, configuration, and startup - perfect for beginners.
Overview
OpenClaw is a self-hosted AI Agent framework for quickly building task-performing intelligent assistants.
Prerequisites
- Node.js 18+
- An AI API Key (OpenAI/Claude/Gemini)
Installation
# Install CLI
npm install -g openclaw
# Verify installation
openclaw --version
Initialize Project
mkdir my-agent && cd my-agent
openclaw init
Configure Agent
Edit openclaw.yaml:
agents:
my-assistant:
model: openai/gpt-4o-mini
apiKey: ${OPENAI_API_KEY}
system: You are a friendly AI assistant
skills:
- weather
- web_search
Launch
# Set API Key
export OPENAI_API_KEY="sk-xxx"
# Start interactive mode
openclaw run my-assistant
Now you can chat with your Agent.
FAQ
What prerequisites must be met before using OpenClaw?▼
You need Node.js 18 or higher installed, and an AI API Key (OpenAI, Claude, or Gemini supported).
How do I install and initialize an OpenClaw project?▼
First run `npm install -g openclaw` to install the CLI, then create a directory and execute `openclaw init` to initialize the project.
Where do I configure the Agent's model and capabilities?▼
Configure in the `openclaw.yaml` file. You can specify the model (e.g., gpt-4o-mini), system prompt, and skills (e.g., weather, web_search).
How do I manage the API Key securely?▼
It's recommended to reference environment variables in the config file (e.g., ${OPENAI_API_KEY}) and set them via terminal command `export OPENAI_API_KEY="sk-xxx"`.
How do I launch the Agent and start chatting?▼
After setting the API Key, run `openclaw run my-assistant` to enter interactive mode and chat with the Agent.
Verification Records
人类专家验证
官方机器人验证