Opengram

OpenClaw Plugin

Connect OpenClaw AI agents to Opengram using the official plugin.

OpenClaw is an open-source AI agent framework for building tool-using, multi-step agents. The @opengramsh/openclaw-plugin plugin connects OpenClaw agents to Opengram, letting them send and receive messages, handle interactive requests, and stream responses through the Opengram chat UI.

Prerequisites

  • Node.js >= 20
  • OpenClaw >= 2026.1.0

How it works

The plugin registers Opengram as a communication channel for your OpenClaw agent. When a message is dispatched to your agent, OpenClaw receives it through the plugin, runs its reasoning loop, and streams responses back through the Opengram API. The plugin handles SSE-based event listening, dispatch claiming, heartbeating, and completing the dispatch lifecycle automatically.

Capabilities

FeatureSupported
Direct chatsYes
Media attachmentsYes
Block streamingYes
Native commandsSoon
ThreadsNo
ReactionsNo

Setup via init wizard

If the openclaw CLI is available on your system, the Opengram init wizard detects it automatically during opengram init. When detected, the wizard offers to configure the OpenClaw plugin and pre-fills the connection settings:

  • Base URL -- the URL of your Opengram instance.
  • Instance secret -- the secret used to authenticate API requests.

This writes the necessary configuration to your OpenClaw project so the plugin can connect to Opengram immediately.

After initial setup, you can reconfigure the plugin at any time with the interactive setup wizard:

openclaw opengram setup

The wizard tests the connection, configures the instance secret, lets you select which agents to link, and optionally restarts the gateway to apply changes.

Manual installation

If you prefer to set up the plugin manually, install it from npm:

npm install @opengramsh/openclaw-plugin

Then register the plugin in your openclaw.json:

{
  "plugins": ["@opengramsh/openclaw-plugin"]
}

And configure the channel:

{
  "channels": {
    "opengram": {
      "baseUrl": "http://localhost:3000",
      "instanceSecret": "your_opengram_instance_secret",
      "agents": ["my-agent"]
    }
  }
}

Start OpenClaw and the plugin connects via SSE, listening for user messages automatically.

Configuration

All configuration lives under channels.opengram in your OpenClaw config file.

KeyTypeDefaultDescription
baseUrlstringhttp://localhost:3000Opengram instance URL
instanceSecretstringAPI auth secret. Also reads OPENGRAM_INSTANCE_SECRET env var.
agentsstring[][]Linked OpenClaw agent IDs
dmPolicystring"pairing"DM policy: open, pairing, allowlist, or disabled
allowFromstring[][]User IDs always permitted to message (used with allowlist policy)
showReasoningMessagesbooleanfalseShow agent reasoning/thinking messages in chat
defaultModelIdstringDefault model ID for chats created in Opengram
reconnectDelayMsnumber3000SSE reconnect delay in ms after connection loss

The plugin also supports an autoRename object for automatic chat title generation. See the Auto Rename feature docs for details.

Agent tools

The plugin provides three tools that your OpenClaw agents can use during their reasoning loop:

  • opengram_chat -- Create, update, and list chats.
  • opengram_media -- Upload media files to a chat.
  • opengram_search -- Full-text search across conversations.

These tools are registered automatically when the plugin loads -- no extra configuration needed.

When to use this plugin

The OpenClaw plugin is a good fit if you are already building agents with OpenClaw and want to give them a chat interface without writing HTTP plumbing yourself. If you are using a different agent framework, or building your agent from scratch, use the Dispatch System and REST API directly instead.

On this page