Traditional billing counts API requests. The agentic era demands more. A single agent session may invoke dozens of tools, consume thousands of reasoning tokens, and run for minutes or hours. Aforo is the first monetization platform built for this reality.
Tool-Call Metering
Bill per successful tool execution, not raw HTTP requests
Token Aggregation
Pass through LLM costs (input + output + reasoning) in real time
Session Billing
Orchestrate access and billing for long-running agent threads
INFO
Aforo treats MCP Servers as a first-class product type — alongside Standard API, Agentic API, and AI Agent. Each has its own metering schema, billing hierarchy, and credential type.
Instead of billing per HTTP request, Aforo meters at the tool execution level. When an AI agent calls tools/call via JSON-RPC, the Aforo gateway plugin (or SDK decorator) extracts the tool name, execution status, and duration:
This enables per-tool pricing. Charge $0.001 for a simple lookup, $0.05 for a database write, and $0.10 for an AI-powered analysis — all within the same MCP server subscription.
The total_provider_cost field feeds directly into the Margin Guard. If a session's provider cost exceeds the contract revenue behind it, Aforo triggers L1-L3 interventions automatically — before the session accumulates more debt.
Agent sessions are long-running. A single session may span minutes, invoke 50+ tool calls, and consume thousands of tokens. Aforo tracks the full session lifecycle:
SESSION LIFECYCLE
ACTIVE → First tool_call assigns a session_id; tool calls metered, tokens aggregated, duration tracked
TIMED_OUT → No activity past the idle timeout (default 3,600s / 1 hr) → session closed automatically
COMPLETED → Explicit close → session closed cleanly
FAILED → Session ended in error
TIMED_OUT, COMPLETED, and FAILED are terminal. Each tool call is metered as it happens; the session record consolidates total tool calls, tokens, duration, and provider cost for full COGS attribution.
MCP Server billing follows the same hierarchy as all Aforo product types:
Customer→Team→Agent→API Key
Usage tracked at Session level. Keys assigned at Agent level. Credential type: CLIENT_CREDENTIALS.
Product TypeHierarchyUsage LevelCredential
Standard APICustomer → Team → AppApp InstanceBEARER_TOKEN
Agentic APICustomer → Team → AppApp InstanceBEARER_TOKEN
AI AgentCustomer → Team → AgentAgent SessionCLIENT_CREDENTIALS
MCP ServerCustomer → Team → AgentSessionCLIENT_CREDENTIALS
PRO TIP
MCP Server is the 4th GA product type in Aforo. It uses the same pricing engine, billing pipeline, and storefront infrastructure as Standard APIs — but with session-aware metering and tool-level pricing granularity built in.
This page walks the on-the-wire side of MCP metering — how a tools/call becomes a billable event, how sessions are tracked, and how the gateway plugins + SDK decorators emit that data. It does not cover:
Creating an MCP Server product in your catalog, wiring the tool registry, and choosing transport/integration mode — see MCP Server (Catalog).
Pricing model choices per tool (per-tool multipliers via dimensionPricing) — same page.
Which billable units to attach to an MCP Server product — see Billable Units.
End-customer registration of agents and rotation of client credentials — see Customers.
Operator-side MCP analytics dashboards. Those live inside the Aforo product console, not on this docs site.