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 the provider cost for a tenant's session exceeds their contract revenue, 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
CREATED → First tool_call detected → session_id assigned
ACTIVE → Tool calls metered, tokens aggregated, duration tracked
IDLE → No activity for 60s → session paused (configurable)
CLOSED → Timeout (1hr default) or explicit close → final billing event
The final billing event consolidates: total tool calls, total tokens, total duration, and total provider cost — allowing you to bill per-session with 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.