Add usage metering and billing telemetry to OpenClaw agents using Drip. Use when you need per-run cost attribution, tool-call usage tracking, and customer-level billing visibility.
技能名称: drip-openclaw-billing
详细描述:
为 OpenClaw 代理集成 Drip,实现运行时间线、工具调用用量计量和客户级计费归属。
bash
clawhub install drip-openclaw-billing
在 CLI 中仅使用标识符(drip-openclaw-billing),而非 owner/slug。
ts
import { OpenClawBilling } from @drip-sdk/node/openclaw;
const billing = new OpenClawBilling({
apiKey: process.env.DRIPAPIKEY,
customerId: cus_123,
workflowId: process.env.DRIPWORKFLOWID ?? wf_openclaw,
});
await billing.withRun({ externalRunId: openclawreq456 }, async ({ runId }) => {
await billing.withToolCall({ runId, provider: brave, endpoint: /res/v1/web/search }, async () => {
// 工具执行
});
});
py
from drip import Drip
import os
client = Drip(apikey=os.environ[DRIPAPI_KEY])
run = client.startrun(customerid=cus123, workflowid=wfopenclaw, externalrunid=openclawreq_456)
client.emitevent(runid=run.id, event_type=tool.call, quantity=1, metadata={provider: brave})
client.trackusage(customerid=cus123, meter=braveapi_calls, quantity=1, metadata={runId: run.id})
client.end_run(run.id, status=COMPLETED)
参见 references/API.md,了解:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 drip-openclaw-billing-1776278090 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 drip-openclaw-billing-1776278090 技能
skillhub install drip-openclaw-billing-1776278090
文件大小: 2.96 KB | 发布时间: 2026-4-16 18:33