← PluginsBeta
Paid Access
Charge people, AI agents, or both for the same post.
An open-source EmDash plugin that puts posts behind Stripe memberships for people and sells them to AI agents with x402 USDC payments, separately or together.
Features
People and AI agents
Charge either audience, or both, for the same post.
Stripe memberships
Plans, Checkout and the customer portal, with email-link sign-in.
x402 pay per read
Agents pay in USDC on Base and get the full post as Markdown.
Rules per post or per tag
Decide in the editor, or cover a whole category at once.
Receipts ledger
Each settled payment, with the amount, payer and a transaction link.
Search-friendly paywall
Paywalled-content structured data and agent discovery links.
Fails closed
If anything can't be verified, nothing unlocks.
Test mode end to end
Stripe test keys for people, Base Sepolia test USDC for agents.
Paid Access is an open-source plugin for EmDash that lets you charge two kinds of readers for the same post. People subscribe through Stripe and sign in with a one-time email link. AI agents pay per read with the x402 protocol , in USDC, and get the full post as clean Markdown. Turn on one, the other, or both.
Why charge AI agents?
More and more of your readers are software. Assistants and research agents fetch posts for someone else, often without loading the page. A paywall built for people can't charge them, and blocking crawlers gives up both the money and the attribution. Paid Access gives agents a door with a price on it: a Markdown version of each post that answers 402 Payment Required until the agent pays.
How it works for people
- You define plans, for example $5 a month, and connect each one to a Stripe product.
- Readers subscribe through Stripe Checkout and manage billing in the Stripe customer portal.
- They sign in with a one-time link sent by email, so there are no passwords to store.
- Locked posts show an excerpt and your pricing. The body never reaches the page's HTML.
How it works for AI agents
- An agent requests the post's Markdown address, such as
/agents/posts/your-post.md. - Paid Access answers 402 Payment Required with the price, the network and your payout address.
- The agent signs a USDC payment and retries. A facilitator verifies it and settles it on Base.
- The agent receives the full post as Markdown, and you get a receipt that links to the transaction.
USDC goes straight to your wallet. The plugin doesn't take a cut.
Use one or both
Each post answers two questions: who can read it for free, and what AI agents pay. That gives four options.
- Free for everyone. People read the page, and agents get free Markdown.
- Free for people, paid for agents. People read the page as usual, and agents pay for the clean Markdown version. The page's HTML stays public, so pair it with bot rules at your CDN if scraping matters to you.
- Members, or agents that pay. People need a plan, and agents can buy a single read.
- Members only. People need a plan, and the post isn't sold to agents.
Set this from the Paid access panel beside each post, or cover a whole category or tag at once.
Search engines still see what they should
Locked posts carry Google's paywalled-content structured data, so search engines can tell a paywall from cloaking. Each page links to its agent-readable version, and a public price list lets agents see what's for sale before they buy.
Built to fail closed
- If Stripe, the payment facilitator or a setting can't be checked, people see the paywall and agents get no content. Nothing unlocks by accident.
- A payment that settles always delivers the post, even if saving the receipt fails.
- Paid responses are marked private and are never cached.
- Sign-in tokens are hashed before they're stored, and sign-in emails are rate limited.
Two parts, one install
EmDash's plugin sandbox keeps plugins from setting payment headers or cookies. So Paid Access comes in two parts: the plugin itself, which handles settings, rules, Stripe, email sign-in and receipts, and a small Astro companion that serves the agent Markdown route, renders the paywall and keeps readers signed in. The plugin can run sandboxed from the EmDash registry or from npm; the companion always comes from npm.
Requirements
- EmDash 1.0.1 or later, on Cloudflare or Node hosting.
- For people: a Stripe account and an email provider plugin, such as EmDash SMTP , to send sign-in links.
- For AI agents: a wallet address on Base. Try it first on Base Sepolia with test USDC.
EMDASH_ENCRYPTION_KEYset on your site, so your Stripe key is stored encrypted.
What's next
- Subscriber tokens, so your members' own AI agents read for free.
- Agent passes: pay once and read for 30 days.
- Charging at the edge through Cloudflare's Monetization Gateway, with prices synced when you publish.
Credits
Paid Access began as a fork of Restrict With Stripe for EmDash by Stranger Studios. It's licensed GPL-2.0-or-later.
Install
# 1. Add the package to your EmDash site
pnpm add emdash-paid-access
// 2. Register the plugin and its Astro companion in astro.config.mjs
import { defineConfig } from "astro/config";
import emdash from "emdash/astro";
import paidAccess from "emdash-paid-access";
import paidAccessAstro from "emdash-paid-access/astro";
export default defineConfig({
integrations: [
paidAccessAstro(),
emdash({ plugins: [paidAccess] }),
],
});
---
// 3. Render post bodies through PaidContent in your post template
import PaidContent from "emdash-paid-access/components/PaidContent.astro";
---
<PaidContent entry={post} />Questions
Do readers need a crypto wallet?
No. People pay by card through Stripe. Only AI agents pay in USDC, using the x402 protocol.
Can I charge AI agents without a paywall for people?
Yes. Choose "Free for people, paid for agents." People keep reading the page as usual, and agents pay for the Markdown version. The full post stays in the page's HTML, so pair it with bot rules at your CDN if scraping matters to you.
How does an AI agent know what to pay?
It requests the post's Markdown address and gets an HTTP 402 response describing the price, network and payout address. Clients that support x402 pay and retry automatically.
Will a paywall hurt my search rankings?
Locked posts include Google's paywalled-content markup, and search crawlers see the same excerpt as everyone else, so the paywall isn't treated as cloaking.
Where does the money go?
Membership payments settle in your Stripe account. Agent payments go directly to your wallet on Base. Paid Access takes no fee.
Can I try it without real money?
Yes. Use Stripe test mode for people and Base Sepolia test USDC for agents, then switch both to live when you're ready.
Does it work alongside Restrict With Stripe?
Yes. Delegate mode leaves member decisions to Restrict With Stripe while you start selling to agents, and you can migrate members over later.
Is it free?
Yes. Paid Access is open source under GPL-2.0-or-later. If you'd like it set up for you, I offer installation and member migration as a service.