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.
OpenClaw connections work differently from n8n and Make.com. Instead of Opsmatic polling your instance with an API key, you install a daemon that pushes data out. There is no Base URL to configure and no pre-save connection test — the connection activates once the daemon delivers its first heartbeat.
How It Works
You create an OpenClaw connection
Opsmatic generates a connection-scoped ingest API key (shown once) for the daemon.
You install the daemon on your OpenClaw host
The daemon auto-detects your gateway and registers itself as a system service.
The daemon pushes heartbeats
Every heartbeat reports gateway status, token usage, and agent activity to
POST /api/v1/openclaw/ingest.Prerequisites
Before connecting OpenClaw to Opsmatic, ensure you have:OpenClaw Gateway
A running OpenClaw gateway you can install software on (self-hosted, behind your firewall)
Node.js Runtime
Node.js on the host so you can install the
@opsmatic/openclaw-daemon npm package globallyService Privileges
Permission to register a system service (systemd on Linux, launchd on macOS)
Outbound HTTPS
The host must reach
https://opsmatic.io over HTTPS to deliver heartbeatsAdding an OpenClaw Connection in Opsmatic
Step-by-Step Setup
Enter Connection Details
Fill in the required information:
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
Click “Save Connection”. Opsmatic creates the connection in an inactive state and generates a dedicated 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
Locate your local OpenClaw gateway and its state directory
Register a Service
Install a system service (systemd or launchd) so the daemon runs persistently
Start Heartbeats
Begin delivering heartbeats to Opsmatic on a recurring interval
Verify Delivery
Confirm the first heartbeat reaches Opsmatic successfully
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
Heartbeats are idempotent. If the daemon retries after a network blip, Opsmatic de-duplicates the beat, so retries never double-count your token usage.
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)
When OpenClaw records the real cost of a request in its session logs (most direct provider integrations do), the daemon forwards that exact figure. This is your source of truth — it reflects what the provider actually charged.
Using OpenRouter? Routed model IDs such as
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.Set Budgets
Configure any combination of daily, weekly, and monthly USD budgets. Each period is independent — leave a field blank to disable that period.
Receive Notifications
Opsmatic sends a budget warning email when spend reaches 80% of a limit and a budget exceeded email when the limit is crossed. Repeat notifications are rate-limited per period (6h for daily, 24h for weekly, 72h for monthly budgets) so a sustained overage doesn’t flood your inbox.
Budget periods follow UTC calendar windows: daily budgets reset at midnight UTC, weekly on Sunday, and monthly on the 1st. Spend is summed from the per-model usage records — including costs Opsmatic computed server-side.
Budget evaluation only runs when at least one budget is configured, so leaving budgets empty adds no overhead to heartbeat processing.
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
Symptoms: The connection never turns Active after setup.Solutions:
- 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
Symptoms: Daemon logs show authentication or permission errors.Solutions:
- 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
Symptoms: Heartbeats arrive but report a non-healthy gateway status.Solutions:
- 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
Symptoms: Cost or token totals seem lower than expected.Solutions:
- 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)
What’s Next?
After successfully connecting your OpenClaw gateway:Test Your Connection
Learn how to validate connection health and read heartbeat status
View Analytics
Explore token usage, cost, and agent analytics for your gateway
Set up n8n
Add n8n connections for comprehensive automation monitoring
Set up Make.com
Connect your Make.com scenarios alongside OpenClaw

