OpenClaw Plugin
Zero code changes
The plugin hooks into every OpenClaw session automatically. No changes to your agent code needed.
Requirements
- OpenClaw 2026.3.2 or later
- Node.js 22 or later
- An AgentMetrics API key — get one at agentmetrics.dev
1. Install the plugin
openclaw plugins install agentmetrics-openclaw
2. Set your API key
Add the key to your shell profile for persistence:
echo 'export AGENTMETRICS_API_KEY=am_live_xxxxxxxxxxxxxxxxxxxx' >> ~/.bashrc
source ~/.bashrc
Or export it for the current session only:
export AGENTMETRICS_API_KEY=am_live_xxxxxxxxxxxxxxxxxxxx
3. Trust the plugin
This silences install-time warnings and the security scan advisory.
openclaw config set plugins.allow '["agentmetrics"]'
If your version of OpenClaw doesn't support the config set command, edit the config file directly:
{
"plugins": {
"allow": ["agentmetrics"]
}
}
The config file is at ~/.openclaw/openclaw.json.
4. Restart the gateway
The plugin loads at gateway startup. A restart is required after install and after setting the API key for the first time.
openclaw gateway restart
5. Confirm your agent name
The plugin reads the agent name from your agent's openclaw.json. Make sure name is set — it becomes the agent_id in AgentMetrics.
{
"name": "my-agent"
}
6. Verify
openclaw plugins list
# agentmetrics loaded
Plugin configuration
Instead of environment variables, you can pass the API key and endpoint directly in your openclaw.json:
{
"plugins": {
"agentmetrics": {
"apiKey": "am_live_...",
"endpoint": "https://api.agentmetrics.dev"
}
}
}
apiKey set here takes precedence over the AGENTMETRICS_API_KEY environment variable. endpoint is optional — only needed for self-hosted deployments.
Config key vs package name
The key in plugins config is agentmetrics (the plugin's manifest id), not agentmetrics-openclaw (the npm package name). Use agentmetrics everywhere in your config file.
Troubleshooting
"dangerous code patterns" warning on install
Safe to ignore. OpenClaw flags plugins that read environment variables and make network calls. The plugin reads AGENTMETRICS_API_KEY and sends it as a Bearer token to the AgentMetrics API. Add agentmetrics to plugins.allow to suppress it permanently.
"manifest id does not match package name" warning
Not an error. The plugin's internal manifest id is agentmetrics; the npm package name is agentmetrics-openclaw. OpenClaw uses the manifest id as the config key, so use agentmetrics (not the npm name) in plugins.allow.
Runs not appearing in the dashboard
- Check the API key is set:
echo $AGENTMETRICS_API_KEY - Verify the plugin is listed as
loadedinopenclaw plugins list - Restart the gateway after any environment variable change
- Check your
openclaw.jsonhas anamefield