Stop blocking agents. Start charging them.
PayFence is the paywall and quota gateway that turns your API into a revenue stream. Deploy in minutes as a proxy or middleware.
HTTP/1.1 402 Payment Required
X-PayFence-Upgrade: https://pay.example.com/plans
{
"error": "quota_exceeded",
"upgrade_url": "..."
}White-glove onboarding for our first 10 customers
How it works
Four steps from zero to revenue.
Connect
Point PayFence at your API origin. We support any HTTP endpoint — REST, GraphQL, or custom protocols.
Define Plans
Set pricing tiers and usage quotas in the dashboard. Charge per request, per month, or per feature.
Deploy
Choose proxy mode for zero-code protection or middleware mode if you want to keep your existing URL.
Earn
Agents pay, you collect revenue via Stripe. Real-time usage dashboards keep you in control.
Two ways to integrate
Choose the deployment model that fits your architecture.
Reverse Proxy
Zero code changes. Agents call your PayFence gateway URL. We validate tokens, enforce quotas, and forward valid requests to your origin with HMAC-signed headers.
Middleware
Keep your URL. Add one API call to your server. We validate tokens and enforce quotas at your edge with a single authorization check.
Built for API builders
From side projects to enterprise platforms, PayFence adapts to your monetization model.
Travel & Booking APIs
Search, availability, and reservation endpoints. Charge per lookup or per booking confirmation.
Data & Intelligence
Market data, analytics, and enrichment APIs. Meter access to your proprietary datasets.
AI Model Endpoints
Inference, embeddings, and fine-tuning APIs. Bill per token, per request, or per model.
Developer Tools
CI/CD, monitoring, and testing APIs. Gate premium features behind paid tiers.
Open Source with Paid Tiers
Offer a generous free tier and monetize power users with premium access and higher quotas.
Frequently asked questions
Everything you need to know about PayFence.
What is PayFence?+
PayFence is a paywall and quota gateway for APIs. It sits between your API consumers and your origin server, enforcing payment and usage limits. Think of it as Stripe Billing meets Cloudflare, purpose-built for API monetization.
How does billing work?+
PayFence integrates with Stripe Connect. You create plans with pricing and quotas in our dashboard. Customers subscribe and receive API tokens. PayFence enforces usage limits automatically — no billing code on your end.
What about latency?+
Proxy mode adds 10–30 ms per request. Middleware mode adds approximately 5 ms (one API call to our edge). Both modes are optimized for low-latency production use with global edge infrastructure.
Do you store request/response bodies?+
No. PayFence only processes metadata: method, path, token, and decision. Request and response bodies pass through untouched and are never logged, cached, or stored.
Can agents bypass the paywall?+
Not with proxy mode — your origin only accepts HMAC-signed requests from PayFence, so there is no way to reach your API directly. With middleware mode, your server validates every request against PayFence before processing it.
Can I avoid the proxy entirely?+
Yes. Middleware mode lets agents call your API directly at your own domain. Your server validates each request with a single PayFence API call before returning a response.