Integrate OpenClaw with G4 Message
Connect your own OpenClaw assistant (or any bot) to your G4 Message WhatsApp number. Inbound messages are pushed to your bot in real time with full conversation, contact and CRM context — and your bot replies straight back to the customer on WhatsApp. Everything runs under your account and your keys. No credentials are shared.
Why connect OpenClaw?
Your own AI bot
Run a custom assistant (MiMo, GPT, or any logic) on your WhatsApp number — trained on your business.
Real-time, low latency
Inbound messages are delivered in seconds. The webhook ACKs instantly, so replies land while the customer is still typing.
Secure by design
Each delivery is HMAC-signed. You set the API key, you own the keys, you host the receiver. Nothing is shared with us.
Clean billing
Bot replies bill your service / broadcast message pools — your AI-credit balance is never touched.
How it works
When a customer messages your WhatsApp number, G4 Message delivers the event to the URL you host, your receiver runs your bot, and the bot replies through the G4 Message API.
Prerequisites
- A G4 Message account with at least one active WhatsApp number.
- A server (or any always-on host) that can run a small Python receiver and be reached by G4 Message at a public or tunnel URL.
- Python 3.8+ with the
requestsandflaskpackages. - Your own OpenClaw assistant (the download below includes a ready-to-use skill & receiver).
Step-by-step installation
-
Create an OpenClaw connection in your account.
Go toSettings → OpenClawin your G4 Message dashboard and click New Connection. Pick a mode:Single number— one bot handles one specific WhatsApp number.All numbers— one bot handles every number on your account.
openclaw_api_key(a Bearer token you choose), and note thewebhook_secretand the issuedg4_api_key(g4oc_…) shown on the connection row. -
Download the OpenClaw package.
Grab the credential-free skill + receiver below and extract it on your host (see the download box). -
Install the skill into your OpenClaw assistant.
Copy the extractedSKILL.mdinto your assistant'sskills/g4-message-openclaw/folder (or just keepreceiver.py+conn.json— the receiver works standalone). -
Configure the receiver.
Copyexamples/conn.example.jsontoconn.jsonand fill in your keys (see the configuration reference below). Never commit real keys to source control. -
Run the receiver.
Start it on the URL you will give G4 Message:
For production, run it behind a process manager (export DARBAR_MODEL_CFG=conn.json python3 receiver.py # listens on http://0.0.0.0:9111 (override with DARBAR_PORT)supervisor/systemd) and expose it athttps://your-host.example/openclaw. -
Point G4 Message at your receiver and enable.
InSettings → OpenClaw, setopenclaw_base_urlto your receiver's public URL (e.g.https://your-host.example/openclaw) and enable the connection. Send a WhatsApp message to your number — your bot should reply within a few seconds.
Download the OpenClaw package
Credential-free skill + ready-to-run receiver + example config. Unzip, add your own keys, run.
g4-message-openclaw.zip Contains:SKILL.md · templates/receiver.py · examples/conn.example.json — no accounts, no SSH, no secrets.
Configuration reference
Your conn.json (or env) fields:
| Field | Description |
|---|---|
saas_base | Your G4 Message base URL, e.g. https://message.g4.business. |
openclaw_api_key | The Bearer token you set when creating the connection. Sent as Authorization: Bearer. |
webhook_secret | Shared secret used to verify the HMAC signature of inbound deliveries. |
g4_api_key | The g4oc_… key G4 Message issued for outbound replies (sent as X-API-Key). |
whatsapp_number_id | The WhatsApp number this bot handles (for Single number mode). |
mode | single or all — matches the connection mode you chose. |
Every inbound delivery is signed with X-G4-Signature: sha256=HMAC(webhook_secret, body) and carries
Authorization: Bearer <openclaw_api_key> + X-G4-Connection. Your receiver must verify both
before processing. The downloadable package does this for you. No G4 Message credentials, SSH details, or Darbar secrets
are included — you connect with your own account and keys.
Bot replies inside the 24-hour service window bill your service-message pool; template / out-of-window replies
bill your broadcast-message pool. Your AI-credit (g4_ai) balance is never deducted by
OpenClaw/API sends. If a pool is exhausted you'll receive a 402 — top it up to continue.
Getting your keys (for the agent / setup wizard)
If an assistant is helping you configure this, it should guide you to:
- Open
Settings → OpenClawin your G4 Message account. - Create (or pick) a connection and read its
webhook_secretand issuedg4_api_key. - Choose the
openclaw_api_key(any secret string you control). - Set the connection's
openclaw_base_urlto your receiver and enable it.
Need help?
Stuck on a step? Open a support ticket from your dashboard and we'll help you wire up your bot.