Skip to main content

Connecting XXAI to OpenClaw - Configuration Guide

This guide walks you through configuring the Matrix channel in the OpenClaw desktop client and pairing it with the XXAI mobile app, so you can access OpenClaw gateway features on your phone through XXAI.

1. Before You Begin​

Make sure the following prerequisites are in place:

ItemDescription
Desktop clientThe latest version of OpenClaw Desktop is installed.
Mobile clientXXAI is installed on your phone, your account is registered, and you have an access token or username and password.
Matrix homeserverYou have deployed, or have access to, a reachable Matrix homeserver.
NetworkBoth your computer and the XXAI app have working internet access.

If you do not yet have a Matrix homeserver, you can either deploy your own or use a public homeserver that supports the Matrix protocol. When you configure the channel, enter a reachable homeserver address and make sure the URL is complete, for example:

https://your-homeserver.example.com

2. Configure OpenClaw on the Desktop​

2.1 Launch the QuickStart Wizard​

OpenClaw QuickStart channel configuration entry

Open the OpenClaw Desktop client and start the QuickStart flow from the Channel / Integration configuration entry point.

The exact label may vary by version, but the entry is typically located at Settings -> Channels -> Add Channel.

This guide only covers the Matrix channel. XXAI connects to OpenClaw over the Matrix protocol.

OpenClaw Matrix channel setup

2.2 Enter the Homeserver URL​

Matrix homeserver URL field

In the Matrix homeserver URL field, enter your homeserver address:

https://d.xxai.com

The homeserver address must include the full protocol prefix, such as https://, and the URL must be reachable from the current machine.

2.3 Choose an Authentication Method​

Under Matrix auth method, choose how OpenClaw will authenticate with your homeserver:

MethodWhen to use itNotes
Access token (recommended)You already have a long-lived token.The user ID is fetched automatically, so no extra input is required.

We recommend selecting Access token (user ID fetched automatically) and pasting your token into the field:

<YOUR_ACCESS_TOKEN>

Matrix access token authentication

An access token is equivalent to your Matrix account credentials. Never commit it to a code repository, share it in screenshots, or expose it in public channels.

2.4 Set a Device Name​

The Matrix Device Name field is optional and lets you assign a friendly name that is easy to recognize, for example:

  • XXAI OpenClaw Gateway
  • MacBook Gateway
  • Windows Gateway

This name appears in the Logged-in devices list of your Matrix client, which makes it easier to manage or revoke credentials later.

2.5 End-to-End Encryption Toggle​

Matrix encryption toggle

For OpenClaw Gateway scenarios, we recommend turning end-to-end encryption (E2EE) off by setting encryption: false, so the gateway can read and process Matrix message content normally.

If you choose to enable E2EE, you need to complete Matrix device key exchange and cross-signing. Otherwise, OpenClaw may not be able to decrypt incoming messages.

Encrypted messages may appear like this:

room_id: !viRQEvGZ4Cxxj0m2:xxai.com
sender: @user_xx:xxai.com
signatures: {
xxai.com: {
ed259:Ab3XX: dbRR6GtWRVMTNjq1FhEPL02DN****************Fd1pjBTot+gOCw
}
}
type: m.room.encrypted

2.6 Main Configuration File​

The desktop client writes the settings above into the channels.matrix section of OpenClaw's main config.json file. The resulting file looks like this:

{
"channels": {
"matrix": {
"enabled": true,
"homeserver": "https://your-homeserver.example.com",
"accessToken": "<YOUR_ACCESS_TOKEN>",
"deviceName": "OpenClaw Gateway",
"encryption": false,
"groupPolicy": "open",
"autoJoin": "always"
}
}
}

2.7 Update an Existing Channel​

If the Matrix channel has already been configured, the wizard will prompt:

Matrix already configured. What do you want to do?

Select Modify settings.

You will then see:

Matrix credentials already configured. Keep them?

Select NO to re-enter your token and device information.

3. Pair the XXAI Mobile App​

Once the desktop is configured, XXAI establishes a trust relationship with the OpenClaw gateway on your computer using a pairing code.

3.1 Get the Pairing Code from the XXAI App​

Open the XXAI app and go to the OpenClaw entry. When you try to connect, you will see a prompt like the one below:

OpenClaw: access not configured.
Your Matrix user id: @your_user:your-homeserver.example.com
Pairing code: XXXXXXXX
Ask the bot owner to approve with:
openclaw pairing approve matrix XXXXXXXX

Take note of the Pairing Code shown in the app. In the example above, it is XXXXXXXX.

3.2 Approve the Pairing Request on Your Desktop​

In the terminal on the machine running OpenClaw Gateway, run:

openclaw pairing approve matrix XXXXXXXX

Replace XXXXXXXX with the actual pairing code displayed in the XXAI app. Once approved, XXAI refreshes automatically and the OpenClaw channel moves to the Connected state in the app.

A pairing code is only valid for a short window. If it expires, generate a new one from the XXAI app and try again.

3.3 Verify the Connection​

You can confirm that the desktop and XXAI app integration is working using any of the following methods:

  • Send a test message from XXAI to a Matrix room you have joined, and confirm that OpenClaw on the desktop receives and proxies it correctly.
  • Send a message from the desktop and confirm it arrives in the XXAI app.
  • Open the Logged-in devices list in your Matrix client and confirm that the OpenClaw Gateway device is listed.

4. Sample Configuration​

Full desktop config.json example with sensitive values redacted:

{
"channels": {
"matrix": {
"enabled": true,
"homeserver": "https://your-homeserver.example.com",
"accessToken": "<YOUR_ACCESS_TOKEN>",
"deviceName": "OpenClaw Gateway",
"encryption": false,
"groupPolicy": "open",
"autoJoin": "always"
}
}
}

5. Troubleshooting​

5.1 XXAI Keeps Showing "OpenClaw: Access Not Configured"​

  • Confirm that every step in Section 2 has been completed on the desktop and the configuration has been saved.
  • Confirm that you ran openclaw pairing approve matrix <code> on the desktop as described in Section 3.2.
  • Check whether the pairing code has expired. If it has, generate a new one from the XXAI app.

5.2 Messages Appear as Type: m.room.encrypted and Cannot Be Read​

This means E2EE is enabled in the room and OpenClaw has not completed key exchange. You have two options:

  • Recommended: Turn off E2EE in Section 2.5 by setting encryption: false on the desktop and use an unencrypted session for that room.
  • Complete cross-signing and key sharing across all of your devices before using the OpenClaw gateway.

5.3 Homeserver Is Unreachable​

  • Make sure the homeserver field includes https://.
  • Open the URL in a browser or network tool from both the desktop and the XXAI app to confirm that the TLS certificate is valid.
  • If you are using an on-prem deployment, make sure the desktop, the XXAI app, and the homeserver are all on the same reachable network.

5.4 Token Is No Longer Valid​

If the access token is revoked on the Matrix side or the device is signed out, OpenClaw will no longer be able to log in. Generate a new token in your Matrix client and re-enter it on the desktop following Section 2.3.

5.5 XXAI Stops Working When OpenClaw Is Closed​

OpenClaw Gateway runs on your local device and requires the application to be running with an active network connection.

For long-running deployments, add OpenClaw to your system's startup items or run it as a background service.

5.6 Permission Issues on Windows or macOS​

  • Windows: Make sure your firewall allows OpenClaw to access the network.
  • macOS: When prompted for network access on first launch, click Allow.

6. Security Recommendations​

  • Never expose your accessToken in public repositories, chat screenshots, or logs.
  • We recommend creating a dedicated Matrix account for OpenClaw rather than reusing your personal account.
  • Periodically review the Logged-in devices list in your Matrix client and revoke OpenClaw Gateway devices you no longer use.