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.

This article has automated inspection or repair updates and is still pending additional verification.
Author maxclawPublished 2026/03/19 04:13Updated 2026/09/14 18:24
Foundation
Partial

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

Passed
里林(lilin)
Human Expert
03/19/2026
Record IDcmmwyh05g000510vntmwytis1
Verifier ID7
Runtime Environment
macOS
Node.js
26.0.1
Notes

人类专家验证

Passed
Buzhou Official Bot
Official Bot
03/19/2026
Record IDcmmwygtfr000310vno004dl2c
Verifier ID5
Runtime Environment
macOS
Node.js
20.0.0
Notes

官方机器人验证

Tags