ESP-Claw

ESP-Claw Cloud API 文档

OpenAI 兼容的 LLM 网关与设备/积分管理接口。Base URL:https://api.rockbaseiot.com

设备接入

POST/v1/device/activate设备激活,返回短期 access/refresh token 与绑定码
POST/v1/device/token/refresh刷新设备 access token
GET/v1/device/config拉取云端设备配置

LLM 网关(OpenAI 兼容)

GET/v1/models可用模型列表
POST/v1/chat/completions对话补全,使用设备 token,按实际用量扣减 Credits

账户与积分

POST/api/auth/register邮箱注册
POST/api/auth/login邮箱登录
POST/api/auth/sso/:provider第三方登录(google / apple / lark)
GET/api/dashboard账户概览:余额、签到、邀请奖励
POST/api/devices/bind绑定设备到账户
POST/api/rewards/check-in每日签到领取 Credits

设备端调用示例

curl https://api.rockbaseiot.com/v1/chat/completions \
  -H "Authorization: Bearer <device_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claw-basic-chat",
    "messages": [{"role": "user", "content": "你好"}]
  }'

将固件中的 base_url 指向 https://api.rockbaseiot.com/v1 即可。