文章目录
- 购买了阿里百炼的lite基础套餐,发现没启用,遂开通API,并把API发给小龙虾进行配置,配置后出现错误,提示 HTTP 401: Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error 研究了一下,发现是APIkey和Base URL配置错误问题。 目前情况是使用基础套餐里面的API和URL还是错误。 遂换回原来的APIkey和URL API Key所属地域的Base URL: 华北2(北京) :https://dashscope.aliyuncs.com/compatible-mode/v1 新加坡:https://dashscope-intl.aliyuncs.com/compatible-mode/v1 美国(弗吉尼亚) :https://dashscope-us.aliyuncs.com/compatible-mode/v1
-
- 把错误的 API Key改成正确的,解决: HTTP 401: Incorrect API key provided
- cd /home/admin/.openclaw
- vi openclaw.json
- 按 i 进入编辑模式 找到: "apiKey": "sk-xxxx" 把里面的内容换成你新的阿里百炼 API Key 格式必须是: "apiKey": "sk-你自己的真实key" 一定要带双引号
- 按 Esc 输入 :wq 按 回车
- systemctl --user restart openclaw-gateway
- systemctl --user status openclaw-gateway 看到 active (running) 就成功了。 其实这一步可以直接与小龙虾进行聊天,如果聊天恢复就修复成功了。
- cd /home/admin/.openclaw vi openclaw.json 修改 API Key → Esc → :wq → 回车 systemctl --user restart openclaw-gateway
购买了阿里百炼的lite基础套餐,发现没启用,遂开通API,并把API发给小龙虾进行配置,配置后出现错误,提示
HTTP 401: Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error
研究了一下,发现是APIkey和Base URL配置错误问题。
目前情况是使用基础套餐里面的API和URL还是错误。
遂换回原来的APIkey和URL
-
API Key所属地域的Base URL:
- 华北2(北京) :
https://dashscope.aliyuncs.com/compatible-mode/v1 - 新加坡:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1 - 美国(弗吉尼亚) :
https://dashscope-us.aliyuncs.com/compatible-mode/v1
- 华北2(北京) :
把错误的 API Key改成正确的,解决:
HTTP 401: Incorrect API key provided
cd /home/admin/.openclaw
cd /home/admin/.openclaw
vi openclaw.json
vi openclaw.json
-
按 i 进入编辑模式
-
找到:
"apiKey": "sk-xxxx"
-
把里面的内容换成你新的阿里百炼 API Key
格式必须是:
"apiKey": "sk-你自己的真实key"
-
一定要带双引号
"apiKey": "sk-xxxx"
格式必须是:
"apiKey": "sk-你自己的真实key"
- 按 Esc
- 输入 :wq
- 按 回车
systemctl --user restart openclaw-gateway
systemctl --user restart openclaw-gateway
systemctl --user status openclaw-gateway
systemctl --user status openclaw-gateway
看到 active (running) 就成功了。
其实这一步可以直接与小龙虾进行聊天,如果聊天恢复就修复成功了。
-
cd /home/admin/.openclaw
-
vi openclaw.json
- 修改 API Key → Esc → :wq → 回车
-
systemctl --user restart openclaw-gateway
cd /home/admin/.openclawvi openclaw.jsonsystemctl --user restart openclaw-gateway

