What is Aforo?#
Aforo is the monetization control plane for enterprise SaaS platforms. It provides the infrastructure to meter usage events, define pricing models, manage entitlements, protect margins, and generate invoices — across any API gateway, AI agent framework, or MCP server.
The platform consists of six core modules:
Product Catalog
Pricing Studio
Metering Engine
Billing Engine
Enterprise Storefront
Revenue Intelligence
Architecture Overview#
Events flow from your API gateways through the metering engine, are rated against your pricing rules, and settle via the 10-stage billing pipeline. Entitlement decisions are served from a Redis-backed cache at the gateway edge.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Gateway │───▶│ Metering │───▶│ Pricing │───▶│ Billing │───▶│ Storefront │
│ Layer │ │ Engine │ │ Studio │ │ Engine │ │ │
│ Kong/Apigee │ │ Validate │ │ 8 Models │ │ 10-Stage │ │ Self-Serve │
│ AWS/Azure │ │ Deduplicate │ │ Rate Plans │ │ Pipeline │ │ Portal │
│ MuleSoft │ │ Enrich │ │ Offers │ │ Wallets │ │ + API Keys │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
Integration Patterns#
Aforo supports five integration tiers, from zero-code gateway plugins to full REST API control:
Tier 0
Gateway Plugin
Kong, Apigee, MuleSoft, AWS, Azure — zero application code
Tier 1
SDK Middleware
Express, FastAPI, Spring Boot — decorator-based metering
Tier 2
REST API
Direct HTTP calls for custom billing and metering flows
Tier 3
Plugs Receiver
Ingest from Stripe, Twilio, SendGrid, GitHub, Slack
Authentication#
All API requests require a Bearer token in the Authorization header.
curl -X POST https://ingest.aforo.ai/v1/ingest \
-H "Authorization: Bearer sk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"customerId": "cust_abc123",
"metricName": "api_calls",
"quantity": 1,
"metadata": { "endpoint": "/v1/search", "model": "gpt-4o" }
}'Rate Limits#
EndpointPurposeNotes
POST /v1/ingestMeter one eventRate-limited per API key at the gateway
POST /v1/ingest/batchMeter many eventsUse for high volume — one call, many events
GET /v1/entitlements/checkRead an entitlementRedis-served, read-only — cheap to call
Error Handling#
All errors return RFC 7807 Problem Detail format:
{
"type": "https://api.aforo.ai/problems/quota-exceeded",
"title": "Quota Exceeded",
"status": 429,
"detail": "This workspace has exceeded its monthly quota.",
"remaining": 0,
"reset_at": "2026-05-01T00:00:00Z"
}