Skip to main content

Overview

Deploy an AI-powered Feishu (Lark) bot using OpenClaw and FoxAPI. This integration allows your team to interact with AI models directly within Feishu conversations.
This guide assumes you have already completed the basic OpenClaw Manual Installation. If not, please set up OpenClaw first.

Prerequisites

FoxAPI API Key

An active FoxAPI API key.

OpenClaw Instance

A running OpenClaw instance (see Manual Installation).

Feishu Developer Account

Access to the Feishu Open Platform (or Lark Open Platform for international).

Configuration

1

Create a Feishu App

  1. Log in to the Feishu Open Platform (or Lark Open Platform for international).
  2. Click Create App > Enterprise Self-Built Application.
  3. Fill in the app name and description.
  4. Note down the App ID (format: cli_xxx) and App Secret.
2

Configure Permissions

In the Feishu Open Platform, navigate to Permissions & Scopes and add the following permissions:
PermissionDescription
im:messageRead and write messages
im:message:send_as_botSend messages as the bot
im:chatAccess chat information
im:chat:readonlyRead chat information
You can batch import permissions via JSON in the Feishu Open Platform to save time.
3

Enable Bot Capability

  1. In the app settings, go to App Capabilities > Bot.
  2. Enable the bot capability.
4

Configure Event Subscriptions

  1. Go to Event Subscriptions.
  2. Select “Use Long Connection” (WebSocket) as the connection method.
  3. Add the event: im.message.receive_v1 (Receive messages).
Using WebSocket long connection means you don’t need a public URL or SSL certificate — the connection is initiated from your server.
5

Install the Feishu Plugin

Install the OpenClaw Feishu plugin:
openclaw plugins install @openclaw/feishu
6

Configure OpenClaw

Add the Feishu configuration to ~/.openclaw/openclaw.json:
{
  "plugins": {
    "entries": {
      "feishu": {
        "enabled": true
      }
    }
  },
  "channels": {
    "feishu": {
      "enabled": true,
      "dmPolicy": "pairing",
      "accounts": {
        "main": {
          "appId": "cli_xxx",
          "appSecret": "your-app-secret",
          "botName": "My AI Assistant"
        }
      }
    }
  }
}
Feishu credentials go under channels.feishu.accounts, NOT under plugins.entries.feishu.
Alternatively, you can set environment variables:
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="your-app-secret"
For Lark international users, add "domain": "lark" to the account configuration.
7

Publish and Test

  1. In the Feishu Open Platform, click Publish to make your bot available.
  2. Add the bot to a Feishu group chat or start a direct conversation.
  3. Send a test message like “Hello!”
  4. The bot should respond using the configured AI model through FoxAPI.

Verify the Connection

Send a message to your Feishu bot:
Who are you? What model are you using?
The bot should reply with a response generated by the AI model configured through FoxAPI.

Troubleshooting

  • Verify appId and appSecret are correct in the config.
  • Check that the bot has been published and approved.
  • Ensure the im.message.receive_v1 event is subscribed.
  • Check OpenClaw logs for errors.
  • Ensure all required permissions are granted in the Feishu Open Platform.
  • Some permissions require admin approval — check the approval status.
  • After adding permissions, you may need to re-publish the bot.
  • Verify the Feishu plugin is installed: check the plugins section in openclaw.json.
  • Ensure "enabled": true is set for both the plugin entry and the channel.
  • Restart the OpenClaw daemon after configuration changes.
  • Verify your FoxAPI API key is valid and has sufficient balance.
  • Test the API key directly:
    curl https://api.foxapi.cc/v1/models \
      -H "Authorization: Bearer sk-your-foxapi-api-key"