Integrate OpenClaw with G4 Message
Launch App
OpenClaw Integration

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.

1
CustomerMessages your WhatsApp number on Meta
2
G4 MessagePushes event (HMAC-signed) to your receiver URL
3
Your receiverRuns your OpenClaw bot with full context
4
Your botReplies via G4 Message API to the customer

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 requests and flask packages.
  • Your own OpenClaw assistant (the download below includes a ready-to-use skill & receiver).

Step-by-step installation

  1. Create an OpenClaw connection in your account.
    Go to Settings → OpenClaw in 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.
    Set your own openclaw_api_key (a Bearer token you choose), and note the webhook_secret and the issued g4_api_key (g4oc_…) shown on the connection row.
  2. Download the OpenClaw package.
    Grab the credential-free skill + receiver below and extract it on your host (see the download box).
  3. Install the skill into your OpenClaw assistant.
    Copy the extracted SKILL.md into your assistant's skills/g4-message-openclaw/ folder (or just keep receiver.py + conn.json — the receiver works standalone).
  4. Configure the receiver.
    Copy examples/conn.example.json to conn.json and fill in your keys (see the configuration reference below). Never commit real keys to source control.
  5. Run the receiver.
    Start it on the URL you will give G4 Message:
    export DARBAR_MODEL_CFG=conn.json
    python3 receiver.py
    # listens on http://0.0.0.0:9111  (override with DARBAR_PORT)
    For production, run it behind a process manager (supervisor/systemd) and expose it at https://your-host.example/openclaw.
  6. Point G4 Message at your receiver and enable.
    In Settings → OpenClaw, set openclaw_base_url to 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:

FieldDescription
saas_baseYour G4 Message base URL, e.g. https://message.g4.business.
openclaw_api_keyThe Bearer token you set when creating the connection. Sent as Authorization: Bearer.
webhook_secretShared secret used to verify the HMAC signature of inbound deliveries.
g4_api_keyThe g4oc_… key G4 Message issued for outbound replies (sent as X-API-Key).
whatsapp_number_idThe WhatsApp number this bot handles (for Single number mode).
modesingle or all — matches the connection mode you chose.
Security model

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.

Billing

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 → OpenClaw in your G4 Message account.
  • Create (or pick) a connection and read its webhook_secret and issued g4_api_key.
  • Choose the openclaw_api_key (any secret string you control).
  • Set the connection's openclaw_base_url to 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.