OpenClaw Setup: AI Agent and Telegram Integration

This guide explains how to set up OpenClaw, connect an AI model, and integrate it with Telegram.

What Is OpenClaw?

OpenClaw is a platform for running personal AI agents on your VPS. It allows you to connect AI models and automate tasks via web interface or messaging apps.

What You Will Need

  • VPS with OpenClaw installed;
  • AI provider account (Anthropic, OpenRouter, etc.);
  • Telegram account (optional).

Step 1: Open OpenClaw Panel

Log in to your client area and click Log in to the OpenClaw panel.

After login, the AI agent is already running but not configured.

Step 2: Get API Key

You need an external AI provider. In this example, Anthropic is used.

Register at:

https://platform.claude.com

After registration:

  • top up your balance;
  • go to API Keys section;
  • click Create key.
Important:
The API key is shown only once. Save it securely.

Step 3: Configure OpenClaw

Go to Config → RAW in OpenClaw panel.

Insert your API key into configuration:

{
  "env": {
    "ANTHROPIC_API_KEY": "YOUR-API-KEY"
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-6"
      }
    }
  }
}

Save changes.

The system will restart automatically.

Step 4: Test AI Agent

Open the Chat section and send a message.

If the agent responds, the setup is successful.

Step 5: Connect Telegram (Optional)

Open Telegram and find BotFather.

Create a new bot and get the API token.

Send the token to OpenClaw chat.

The agent will configure integration automatically.

Step 6: Test Telegram Bot

Open your bot and send /start.

If the bot replies, integration is complete.

What You Can Do Next

  • automate tasks with AI;
  • build Telegram bots;
  • integrate APIs and workflows;
  • extend agent capabilities.
Important:
Do not expose API keys or bot tokens publicly.