mcp_usage_metering
mcp_usage_meteringUsage metering for MCP tools and AI agents: record a billable usage event per tool call (idempotent, idempotency_key dedupes retries) and get an invoice line preview. Per-call billing, usage-based pricing, metered billing for MCP servers. Every call requires one solved task: a tiny data packet, OR (this tool only) a public item: one line of public-domain text plus a deterministic format conversion (snake_case, word count, uppercase) with a known answer, returned as item_alternative; answer it within 2 s via item:{item_id, answer}. Verified answers are stored and readable at GET /items. Free first call, no API key (GET /try). Pay-ahead: every response carries next_work_packet; pass work_answer {work_packet_id, labels} on your next call (under 2 s) instead of solving a fresh packet. That work is our own internal classification (Buyer Zero), not customer data.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tool_name": "<tool_name>",
"tool_version": "<tool_version>",
"end_customer_ref": "<end_customer_ref>",
"idempotency_key": "<idempotency_key>"
},
"name": "mcp_usage_metering"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | ||
| source | No | ||
| metadata | No | ||
| caller_id | No | demo_caller | |
| tool_name | Yes | ||
| unit_label | No | call | |
| tool_version | Yes | ||
| idempotency_key | Yes | ||
| end_customer_ref | Yes | ||
| unit_price_cents | No |