Sign in →
Getting Started1 min read

Introduction to Aforo

The enterprise monetization control plane for usage-based billing, entitlement enforcement, and margin protection across any API gateway or AI agent framework.

Updated 2026-06-15Suggest edits
Docs Getting Started Introduction

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. Sub-5ms entitlement decisions at the gateway edge.

architecture-flow.txt
┌──────────────┐    ┌──────────────┐    ┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│   Gateway    │───▶│   Metering   │───▶│   Pricing    │───▶│   Billing    │───▶│  Storefront  │
│    Layer     │    │    Engine    │    │    Studio    │    │    Engine    │    │              │
│ Kong/Apigee  │    │ Validate     │    │ 6 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.

request.sh
curl -X POST https://api.aforo.ai/v1/meter \
  -H "Authorization: Bearer sk_live_abc123def456" \
  -H "X-Tenant-Id: tenant_uuid_789" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "api_call",
    "metric_id": "metric_uuid",
    "quantity": 1,
    "properties": { "endpoint": "/v1/search", "model": "gpt-4o" }
  }'

Rate Limits#

EndpointRate LimitBurst
POST /v1/meter10,000 req/min1,000
POST /v1/canAccess50,000 req/min5,000
GET /v1/entitlements5,000 req/min500

Error Handling#

All errors return RFC 7807 Problem Detail format:

error-response.json
{
  "type": "https://api.aforo.ai/errors/quota-exceeded",
  "title": "Quota Exceeded",
  "status": 429,
  "detail": "Tenant has exceeded their monthly API quota.",
  "tenant_id": "tenant_uuid_123",
  "remaining": 0,
  "reset_at": "2026-04-01T00:00:00Z"
}