Mac安装OpenClaw龙虾AI助手并接入飞书全流程:安装Node、部署OpenClaw、配置API Key接入飞书全流程

在线体验各类最新模型,更有模型 免费Token 额度领取!
立即体验
简介: OpenClaw是开源个人AI助手平台,支持多IM渠道接入。本文以Mac为例,详解安装步骤、对接阿里云百炼(Token/Coding Plan或按量付费)、配置API Key及飞书机器人全流程,助你快速搭建本地AI助手。OpenClaw云端部署教程:https://t.aliyun.com/U/z5eiGA

OpenClaw 是一个开源的个人 AI 助手平台,支持通过多种IM消息渠道 AI 交互。通过配置可接入阿里云百炼平台上的 AI 模型,AI模型支持按量付费、Coding Plan、Token Plan 团队版三种接入方式。本文阿小云以本地Mac OS操作系统为例,现在本地电脑安装OpenClaw,然后调用阿里云百炼平台的Token,调用百炼API Key有三种方法,最后接入飞书全流程。如果是云端部署OpenClaw,可以参考阿里云官方关于OpenClaw的部署教程:https://www.aliyun.com/activity/ecs/clawdbot

云端部署安装OpenClaw.jpg


一、安装 OpenClaw

1、检查并安装Node.js

OpenClaw 需要 Node.js 22 或更高版本。可通过以下命令检查 Node.js 版本,打开终端,执行命令:

node --version

如果未安装或版本过低,请访问 Node.js 官网下载安装。

2、安装OpenClaw

推荐使用官方安装脚本:

curl -fsSL https://openclaw.ai/install.sh | bash

或通过 npm 全局安装:

npm install -g openclaw@latest

首次安装后,OpenClaw 会自动启动配置向导,完成初始设置。也可以手动执行openclaw onboard命令进行配置。

配置项

建议配置

I understand this is powerful and inherently risky. Continue?

选择 Yes

Onboarding mode

选择 QuickStart

Model/auth provider

选择 Skip for now(稍后配置百炼模型)

Filter models by provider

选择 All providers

Default model

选择 Keep current

Select channel (QuickStart)

选择 Skip for now(稍后配置渠道)

Configure skills now? (recommended)

选择 No

Enable hooks?

按空格键选中选项,按回车键进入下一步

How do you want to hatch your bot?

选择 Do this later



二、订阅百炼AI模型API Key

接入阿里云百炼平台AI模型的API Key有三种方式,可以开通Token PlanCoding Plan或者按量付费使用Token,三种方法如下,以下三种方法三选一:


方法1、接入Token Plan 团队版

阿里云百炼TokenPlan团队版官网:https://www.aliyun.com/benefit/scene/tokenplan  需要先购买套餐,目前最低是198元1个月,如下图:

阿里云百炼TokenPlan团队版订阅计划.jpg

订阅之后获取 Token Plan 团队版专属 API Key,TokenPlan的API Key如下:

API Key

Token Plan 团队版专属API Key

Base URL


https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic

可用模型

Token Plan 团队版支持的模型


配置文件位于 ~/.openclaw/openclaw.json,OpenClaw 启动时会自动读取。查看:Token Plan 团队版专属API Key获取方法


获取到阿里云百炼Token Plan团队版的API Key后,跳转到【三、配置AI模型的API Key】


方法2、接入Coding Plan 团队版

阿里云Coding Plan官网:https://www.aliyun.com/benefit/scene/codingplan  如下图,目前只有Pro高级版,费用是200元1个月,如下图:

阿里云百炼CodingPlan介绍配置及价格.jpg


订阅之后,获取CodingPlan的API Key:

API Key

Coding Plan 专属 API Key,格式为 sk-sp-xxxxx

Base URL


https://coding.dashscope.aliyuncs.com/apps/anthropic

可用模型

Coding Plan 支持的模型


获取Coding Plan的API Key,然后跳转到【三、配置AI模型的API Key】



方法3、按量使用百炼Token

在阿里云百炼平台:https://www.aliyun.com/product/bailian  获取到API Key:https://help.aliyun.com/zh/model-studio/get-api-key


API Key

阿里云百炼 API Key,格式为 sk-xxxxx

Base URL

请确保 Base URL、API Key 和模型归属同一地域:

可用模型

填入模型广场中支持的模型

以下配置以华北2(北京)地域为例,如使用其他地域请替换 baseUrl 为上表中对应地域的 URL。

配置文件位于 ~/.openclaw/openclaw.json,OpenClaw 启动时会自动读取。


三、配置AI模型的API Key


1、Mac电脑打开终端,打开配置文件:

nano ~/.openclaw/openclaw.json

2、写入配置,首次配置:复制以下内容到配置文件,将 YOUR_API_KEY 替换为【Token Plan的API Key】、【CodingPlan的API Key】或者【百炼按量计费的API Key】,三选一:

{
  "meta": {
    "lastTouchedVersion": "2026.2.1",
    "lastTouchedAt": "2026-02-03T08:20:00.000Z"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "bailian-token-plan": {
        "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
        "apiKey": "YOUR_API_KEY",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "qwen3.7-max",
            "name": "qwen3.7-max",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 1000000,
            "maxTokens": 65536,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "qwen3.7-plus",
            "name": "qwen3.7-plus",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 1000000,
            "maxTokens": 65536,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "qwen3.6-plus",
            "name": "qwen3.6-plus",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 1000000,
            "maxTokens": 65536,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "qwen3.6-flash",
            "name": "qwen3.6-flash",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 1000000,
            "maxTokens": 32768,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "deepseek-v4-pro",
            "name": "deepseek-v4-pro",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 163840,
            "maxTokens": 32768,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "deepseek-v4-flash",
            "name": "deepseek-v4-flash",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 163840,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "deepseek-v3.2",
            "name": "deepseek-v3.2",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 163840,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "kimi-k2.7-code",
            "name": "kimi-k2.7-code",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 262144,
            "maxTokens": 32768,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "kimi-k2.6",
            "name": "kimi-k2.6",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 262144,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "kimi-k2.5",
            "name": "kimi-k2.5",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 262144,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "glm-5.2",
            "name": "glm-5.2",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 1000000,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "glm-5.1",
            "name": "glm-5.1",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 202752,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "glm-5",
            "name": "glm-5",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 202752,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "MiniMax-M2.5",
            "name": "MiniMax-M2.5",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 204800,
            "maxTokens": 131072,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "bailian-token-plan/qwen3.7-plus"
      },
      "models": {
        "bailian-token-plan/qwen3.7-max": {},
        "bailian-token-plan/qwen3.7-plus": {},
        "bailian-token-plan/qwen3.6-plus": {},
        "bailian-token-plan/qwen3.6-flash": {},
        "bailian-token-plan/deepseek-v4-pro": {},
        "bailian-token-plan/deepseek-v4-flash": {},
        "bailian-token-plan/deepseek-v3.2": {},
        "bailian-token-plan/kimi-k2.7-code": {},
        "bailian-token-plan/kimi-k2.6": {},
        "bailian-token-plan/kimi-k2.5": {},
        "bailian-token-plan/glm-5.2": {},
        "bailian-token-plan/glm-5.1": {},
        "bailian-token-plan/glm-5": {},
        "bailian-token-plan/MiniMax-M2.5": {}
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": { "mode": "none" }
  }
}

3、保存并退出,按 Ctrl+X,按 Y 确认保存,按 Enter 确认文件名


4、使配置生效,运行以下命令重启网关,使配置生效

openclaw gateway restart


四、接入飞书

步骤一:创建飞书应用

  1. 访问飞书开放平台,单击创建企业自建应用,填写应用名称和描述,选择应用图标,单击创建
  2. 左侧导航栏单击凭证与基础信息 页面,复制App ID(格式如 cli_xxx)和App Secret
  3. 左侧导航栏单击 权限管理页面,单击批量导入/导出权限 按钮,粘贴以下 JSON 配置,单击下一步,确认新增权限,单击申请开通


JSON配置文件内容:

   {
     "scopes": {
       "tenant": [
         "aily:file:read",
         "aily:file:write",
         "application:application.app_message_stats.overview:readonly",
         "application:application:self_manage",
         "application:bot.menu:write",
         "cardkit:card:write",
         "contact:user.employee_id:readonly",
         "corehr:file:download",
         "docs:document.content:read",
         "event:ip_list",
         "im:chat",
         "im:chat.access_event.bot_p2p_chat:read",
         "im:chat.members:bot_access",
         "im:message",
         "im:message.group_at_msg:readonly",
         "im:message.group_msg",
         "im:message.p2p_msg:readonly",
         "im:message:readonly",
         "im:message:send_as_bot",
         "im:resource",
         "sheets:spreadsheet",
         "wiki:wiki:readonly"
       ],
       "user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
     }
   }
  1. 左侧导航栏中单击, 选择按能力添加页签,找到机器人卡片,单击配置
  2. 配置事件订阅。
  1. 在飞书开放平台左侧导航栏单击事件与回调,在事件配置页签中单击订阅方式,选择使用 长连接 接收事件,单击保存
  2. 在事件配置页面,单击添加事件,搜索事件im.message.receive_v1(接收消息),单击确认添加
  1. 版本管理与发布 页面创建版本,填写应用版本号更新说明,单击保存,提交审核并发布。


步骤二:配置飞书机器人

1、在终端中输入以下命令配置飞书渠道

openclaw channels add


根据界面交互提示,完成以下配置。

  • 选择 Feishu
  • 输入 App ID
  • 输入 App Secret

配置完成后,重启网关。 2. 创建群聊或在已有群聊中添加机器人,在飞书群中@机器人进行对话,或通过搜索的方式与机器人私聊进行测试。 3. 在群聊中添加机器人:设置。 4. 单击机器人头像,单击发送消息,可向机器人私发一条消息,机器人会回复一条包含配对码的消息。 5. 复制消息的最后一行,在 OpenClaw 对话中发送,OpenClaw 会自动完成飞书机器人配对。


步骤三:测试

1、执行以下命令重启网关。

openclaw gateway restart

2、执行以下命令检查飞书渠道状态

openclaw status

在 Channels 部分,Feishu 应显示为 ON 且状态为 OK


3. 在飞书中发送消息进行测试。


至此在MacOS电脑上安装OpenClaw龙虾AI助手,使用阿里云百炼AI模型的API Key调用模型,并接入飞书的全流程完毕。

相关文章
|
9天前
|
人工智能 JSON 自然语言处理
让教学更智慧:用阿里云百炼工作流,自动生成中小学教材内容#小有可为#有温度的AI
通过可视化工作流编排,将大模型推理能力转化为标准化的教学内容生成引擎。教师只需输入教材标题和适用学段,即可自动获得结构完整、符合课程标准的章节内容,大幅降低备课门槛,助力教育资源均衡化。
483 125
|
18天前
|
Linux 程序员 数据格式
【2026最新】Notepad++下载、安装和使用一篇搞定(附中文版安装包)
Notepad++ 是一款免费开源、轻量高效的 Windows 文本编辑器,支持 C/Python/HTML 等 80+ 语言语法高亮、代码折叠、正则替换、编码转换及插件扩展,专为程序员与文本处理用户打造,完美替代系统记事本。(239字)
|
3天前
|
人工智能 缓存 安全
Claude Code 封号真实原因曝光,这次彻底不装了,直接针对国内开发者的账号下手?
Claude Code 封号潮背后:逆向扒出客户端隐写区域标记,Anthropic 政策收紧叠加 DeepSeek 7 月涨价,国产替代更紧迫。
|
5天前
|
人工智能 安全 Cloud Native
Higress 新发布:AI Gateway 能力增强,Gateway API 及其推理扩展持续打磨
增强 AI 网关能力,持续打磨 Gateway API 及其推理扩展。
322 124
|
13天前
|
机器学习/深度学习 人工智能 调度
🐴 HappyHorse 1.1 现已上线阿里云百炼!快来查收模型使用指南,现在调用享 6 折~
HappyHorse 1.1 是新一代视频生成大模型,全面升级动态表现力、角色一致性、指令遵循、视觉质感与音画协同能力。支持I2V/T2V/R2V三类生成,适配短剧、电商广告、品牌营销等场景,提供高质、流畅、可控的AI视频生产力。
810 5
🐴 HappyHorse 1.1 现已上线阿里云百炼!快来查收模型使用指南,现在调用享 6 折~
|
4天前
|
人工智能 安全 程序员
终于,Claude Code 封号的原因被曝光了!竟然针对中国用户,植入隐形代码?!
通俗易懂地揭秘 Claude Code 封号的手段,分享一些自己对 AI 编程困境的思考,Codex、Cursor、DeepSeek、智谱 GLM、甚至是豆包,都有所行动了
321 1
|
11天前
|
人工智能 定位技术 SEO
我学 GEO 第 15 天:终于知道AI GEO该如何做?
我是暴走的莉莉酱,边旅行边研究AI GEO的数字游民。专注普通人如何提升“AI可见度”——让AI在回答用户问题时准确识别、理解并推荐你。不讲玄学,只做可测、可调、可持续的GEO实践。
458 127

热门文章

最新文章