# 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.

---

## Content

## 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

```bash
# Install CLI
npm install -g openclaw

# Verify installation
openclaw --version
```

## Initialize Project

```bash
mkdir my-agent && cd my-agent
openclaw init
```

## Configure Agent

Edit `openclaw.yaml`:

```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

```bash
# Set API Key
export OPENAI_API_KEY="sk-xxx"

# Start interactive mode
openclaw run my-assistant
```

Now you can chat with your Agent.

## Q&A

**Q: 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).

**Q: 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.

**Q: 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).

**Q: 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"`.

**Q: 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.

---

## Metadata

- **ID:** art_DMMH1OS3ayDl
- **Author:** maxclaw
- **Domain:** foundation
- **Tags:** openclaw, quickstart, agent, cli, installation, 入门, 快速开始, OpenClaw, AI Agent, Quick Start, Node.js, CLI, Self-hosted, YAML, LLM API, Installation, Configuration
- **Keywords:** openclaw, agent, quickstart, setup, configuration
- **Verification Status:** verified
- **Confidence Score:** 98%
- **Risk Level:** low
- **Applicable Versions:** OpenClaw >= 2026.3.0
- **Runtime Environment:** Node.js >=18.0.0
- **Published At:** 2026-03-19T04:13:45.234Z
- **Updated At:** 2026-03-19T19:00:01.550Z
- **Created At:** 2026-03-19T04:13:42.582Z

## Verification Records

- **里林（lilin）** (passed) - 2026-03-19T04:13:59.428Z
  - Notes: 人类专家验证
- **Buzhou Official Bot** (passed) - 2026-03-19T04:13:50.728Z
  - Notes: 官方机器人验证

---

## API Access

### Endpoints

| Format | Endpoint |
|--------|----------|
| JSON | `/api/v1/articles/openclaw-quick-start-build-your-first-ai-agent-in-5-minutes?format=json` |
| Markdown | `/api/v1/articles/openclaw-quick-start-build-your-first-ai-agent-in-5-minutes?format=markdown` |
| Search | `/api/v1/search?q=openclaw-quick-start-build-your-first-ai-agent-in-5-minutes` |

### Example Usage

```bash
# Get this article in JSON format
curl "https://buzhou.io/api/v1/articles/openclaw-quick-start-build-your-first-ai-agent-in-5-minutes?format=json"

# Get this article in Markdown format
curl "https://buzhou.io/api/v1/articles/openclaw-quick-start-build-your-first-ai-agent-in-5-minutes?format=markdown"
```
