Overview
OpenClaw is a self-hosted AI agent gateway that runs behind your own firewall. Because Opsmatic cannot reach it directly, OpenClaw monitoring is push-based: a lightweight daemon (@opsmatic/openclaw-daemon) runs alongside your gateway and pushes periodic heartbeats to Opsmatic. Those heartbeats carry gateway health, token usage, per-agent and per-model cost breakdowns, and agent inventory — giving you the same availability and analytics experience as n8n and Make.com, plus AI spend tracking.
How It Works
You create an OpenClaw connection
You install the daemon on your OpenClaw host
The daemon pushes heartbeats
POST /api/v1/openclaw/ingest.Opsmatic monitors and alerts
Prerequisites
Before connecting OpenClaw to Opsmatic, ensure you have:OpenClaw Gateway
Node.js Runtime
@opsmatic/openclaw-daemon npm package globallyService Privileges
Outbound HTTPS
https://opsmatic.io over HTTPS to deliver heartbeatsAdding an OpenClaw Connection in Opsmatic
Step-by-Step Setup
Navigate to Connections
Add New Connection
Select OpenClaw
Enter Connection Details
Basic Information
Basic Information
- Connection Name: Descriptive name (e.g., “Production OpenClaw Gateway”)
- Organization: Choose personal or organization context
Monitoring
Monitoring
- Enable monitoring: Toggle on to start tracking heartbeats as soon as they arrive
Save Connection
Copy the Ingest API Key
Installing the Daemon
On the host running your OpenClaw gateway, install the daemon and run the setup wizard with the ingest API key from the previous step:Auto-detect the Gateway
Register a Service
Start Heartbeats
Verify Delivery
What Data is Monitored
Each heartbeat carries a snapshot of your gateway. Opsmatic persists and analyzes:Gateway Health
Gateway Health
- Gateway status:
healthy,degraded, orunreachable - Gateway latency (ms) and version
- Whether the gateway process is alive
- Mirrored into availability metrics so uptime and response-time charts work like any other connection
Token Usage & Cost
Token Usage & Cost
- Input, output, and cache read/write tokens per period
- Estimated cost in USD — provider-reported when OpenClaw logs it, otherwise computed by Opsmatic (see How Costs Are Calculated)
- Request counts per period
- Rolling totals since the daemon started
Per-Model & Per-Agent Breakdowns
Per-Model & Per-Agent Breakdowns
- Token usage and cost grouped by model and provider
- Token usage and cost grouped by agent
- Feeds the analytics views for identifying your most expensive models and agents
Agent Inventory
Agent Inventory
- Agent ID and name
- Default model and configured channels
- Skill count and last activity timestamp
- Agent status (active/inactive)
System Diagnostics
System Diagnostics
- Daemon version and uptime
- Host platform and Node.js version
- OpenClaw state directory size
How Costs Are Calculated
Opsmatic uses a two-tier cost model for OpenClaw. The daemon never guesses prices — it reports what OpenClaw actually logged, and Opsmatic fills in the rest:Provider-reported cost (preferred)
Server-side pricing (fallback)
openrouter/anthropic/claude-sonnet-4-5 resolve to the underlying model’s price automatically. The special openrouter/auto model cannot be priced from tokens — the routed model differs per request — so those requests show $0 cost unless OpenRouter’s actual cost appears in the OpenClaw logs. Token counts are always tracked accurately either way.Budget Alerts
OpenClaw connections support spend budgets so you get notified before costs run away.Open the Connection
Set Budgets
Receive Notifications
Anomaly Detection
OpenClaw token spend is included in Opsmatic’s statistical anomaly detection. Using a rolling 7-day baseline, Opsmatic flags unusual spikes in token spend (alongside response time and execution failure rate for other platforms), opens an anomaly with an alert email, and resolves it automatically when spend returns to normal. Open anomalies are also queryable viaGET /api/v1/anomalies.
Security Best Practices
Scoped Ingest Key
- The ingest key can only push usage data for its one connection
- It cannot read your other connections or account data
- Rotate it by recreating the connection if it’s ever exposed
Outbound Only
- The daemon initiates all traffic outbound over HTTPS
- No inbound ports need to be opened on your firewall
- Your gateway stays fully behind your network perimeter
Troubleshooting
Connection stays Inactive
Connection stays Inactive
- Confirm the daemon service is running on the host (
systemctl status/launchctl list) - Verify the host can reach
https://opsmatic.ioover HTTPS (check outbound firewall rules) - Re-run
opsmatic-ocwd setupwith the correct ingest API key - Check the daemon logs for delivery errors
401 / 403 on heartbeat delivery
401 / 403 on heartbeat delivery
- Ensure you used the ingest API key generated for this connection
- The key must be a usage-ingestion key scoped to the connection — keys created elsewhere won’t work
- If the key was lost or rotated, recreate the connection to issue a new one
Gateway shows Degraded or Unreachable
Gateway shows Degraded or Unreachable
- Check that the OpenClaw gateway process is running and responsive
- Review gateway latency in the connection details for performance issues
- Confirm the daemon auto-detected the correct gateway URL during setup
Token usage looks incomplete
Token usage looks incomplete
- Token data is read from OpenClaw session logs; confirm the daemon can access the gateway’s state directory
- Allow a few heartbeat cycles for backfill after a fresh install or daemon restart
- Verify the daemon version is current (
npm i -g @opsmatic/openclaw-daemon) - If you route through
openrouter/auto, costs show as $0 when OpenClaw doesn’t log the provider’s actual charge — token counts remain accurate (see How Costs Are Calculated)

