所有 Claw API 端点都需要通过 Authorization: Bearer sk-... 请求头进行身份验证。
基础 URL: https://api.lemondata.cc/v1/claw
列出实例
返回经过身份验证的组织的所有实例。
curl https://api.lemondata.cc/v1/claw/instances \
-H "Authorization: Bearer sk-your-api-key"
{
"instances": [
{
"id": "cm5abc123",
"subdomain": "mybot",
"url": "https://claw-mybot.lemondata.cc",
"defaultModel": "claude-opus-4-6",
"hasIMConfig": true,
"status": "RUNNING",
"paidUntil": "2026-03-10T00:00:00.000Z",
"canRebuild": true,
"totalPaid": 20,
"createdAt": "2026-02-08T00:00:00.000Z"
}
]
}
实例状态值
| 状态 | 描述 |
|---|
PENDING | 刚刚创建,正在等待配置 |
PROVISIONING | 容器正在部署中 |
RUNNING | 实例已激活且运行正常 |
STOPPED | 因过期而停止(数据保留 7 天) |
FAILED | 部署失败(已自动退款) |
DELETED | 已永久删除 |
创建实例
创建一个新实例,并从您的组织余额中扣除 $20,有效期为 30 天。
子域名(3-32 个字符,小写字母数字 + 连字符)。实例 URL:https://claw-{subdomain}.lemondata.cc
默认 AI 模型(例如:claude-opus-4-6、gpt-5.2、gemini-3-pro-preview、minimax-m2.5、kimi-k2.5)
curl -X POST https://api.lemondata.cc/v1/claw/instances \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"subdomain": "mybot", "defaultModel": "claude-opus-4-6"}'
{
"id": "cm5abc123",
"subdomain": "mybot",
"url": "https://claw-mybot.lemondata.cc",
"status": "PENDING",
"paidUntil": "2026-03-10T00:00:00.000Z",
"charged": true,
"chargedAmount": 20
}
余额不足将返回 402 Payment Required。在创建实例前,请确保您的组织余额至少有 $20。
获取实例
GET /v1/claw/instances/:id
返回特定实例的详细信息。
更新实例
PATCH /v1/claw/instances/:id
更新实例配置。
更新 IM 平台配置(Telegram、Discord 等)
curl -X PATCH https://api.lemondata.cc/v1/claw/instances/cm5abc123 \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"defaultModel": "claude-sonnet-4-5"}'
重建实例
POST /v1/claw/instances/:id/rebuild
在保留数据 (PVC) 的同时销毁并重新创建容器。限制为每天 10 次重建。
如果超过每日限制,将返回 429 Too Many Requests。
续订实例
POST /v1/claw/instances/:id/renew
延长计费周期 30 天($20)。如果实例因过期而停止,它将自动重启。
{
"id": "cm5abc123",
"subdomain": "mybot",
"status": "RUNNING",
"paidUntil": "2026-04-09T00:00:00.000Z",
"charged": true,
"chargedAmount": 20
}
健康检查
返回 Claw 服务的健康状态。无需身份验证。
{"status": "ok", "timestamp": "2026-02-08T15:00:00.000Z"}