Drip OpenClaw Billing — 使用 Drip 的 OpenClaw 代理使用量计量和计费遥测
v1.1.1该技能通过 Drip 为 OpenClaw 代理添加使用量计量和计费遥测功能。适用于需要按运行成本归属、工具调用使用跟踪和客户级别计费可见性的场景。
详细分析 ▾
运行时依赖
版本
安全对齐更新:元数据一致性修复、明确的 OpenClaw 身份令牌命名、加强隐私合同、友好扫描器的 _meta 模式。
安装命令 点击复制
技能文档
使用 Drip 为 OpenClaw 代理植入仪器,实现运行时间线、工具调用使用量计量和客户级计费归属。
安装(复制/粘贴)
clawhub install drip-openclaw-billing
CLI 中仅使用 slug(drip-openclaw-billing),不要使用owner/slug。
这能为你提供什么
- 每次运行的计费可追溯性(
start_run→ 事件 → 使用量 →end_run) - 按单位计量使用量(token、工具调用、API 调用、计算时间)
- Drip 中客户/项目级成本和使用量可见性
- 幂等写入,实现重试安全的遥测
集成路径
- 推荐:
DRIP_API_KEY配合/v1/端点,实现完整计费 + 遥测控制。 - 轻量:
OPENCLAW_IDENTITY_TOKEN配合/openclaw/端点。
安全规则
- 使用最小权限运行时密钥(优先使用作用域遥测密钥)。
- 永远不要发送原始提示、原始模型输出、凭证或个人身份信息。
- 仅发送清理后的元数据(如需要时对内容字段进行哈希,如
queryHash)。 - 为所有写入发出稳定的幂等密钥。
- 生产发布前在测试环境验证负载模式。
快速开始(Node.js)
import { OpenClawBilling } from '@drip-sdk/node/openclaw';const billing = new OpenClawBilling({
apiKey: process.env.DRIP_API_KEY,
customerId: 'cus_123',
workflowId: process.env.DRIP_WORKFLOW_ID ?? 'wf_openclaw',
});
await billing.withRun({ externalRunId: 'openclaw_req_456' }, async ({ runId }) => {
await billing.withToolCall({ runId, provider: 'brave', endpoint: '/res/v1/web/search' }, async () => {
// 工具执行
});
});
快速开始(Python)
from drip import Drip
import osclient = Drip(api_key=os.environ['DRIP_API_KEY'])
run = client.start_run(customer_id='cus_123', workflow_id='wf_openclaw', external_run_id='openclaw_req_456')
client.emit_event(run_id=run.id, event_type='tool.call', quantity=1, metadata={'provider': 'brave'})
client.track_usage(customer_id='cus_123', meter='brave_api_calls', quantity=1, metadata={'runId': run.id})
client.end_run(run.id, status='COMPLETED')
加载详细 API 文档
见 references/API.md 了解:
- 端点形状
- 运行/事件/使用量生命周期
- 定价单位和速率限制说明
- 错误处理模式
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制