Agent Paywall for WordPress
AI agents pay to read what you choose. People see your site as always. No WooCommerce needed.
What it does
AI agents — assistants, research tools, crawlers — read websites for their users. With this plugin they pay you for it. When an agent opens a post you made paid, your site answers 402 Payment Required with a price; the agent pays in USDC and gets the post. The money goes to your wallet. People visiting your site see nothing different.
Set up
Install it from the WordPress.org plugin directory: Plugins → Add New, search for “P2Flux Agent Paywall”. (The ZIP is also on GitHub.)
- Install and activate P2Flux Agent Paywall.
- Settings → Agent Paywall: paste your wallet address (a wallet on Base that receives USDC). P2Flux checks the address when you save; a mistyped one is refused.
- Choose what agents pay for and the price. Save.
No account, no API key, nothing to install on the server. Start in Test mode (Base Sepolia, test USDC) and switch to Live when you have seen it work.
What agents pay for
In lists, feeds, search and REST collections an agent sees the title and the price of a paid post, not its text. The smallest price is 0.01 USDC.
Paid files
A file in the Media Library — a PDF, a dataset, an image — can have a price too: open the file and fill in “Price for AI agents”. People download it as always; an agent gets 402 and the file after payment.
WordPress does not see requests for uploaded files; the web server answers them itself. So the plugin writes a rule into the uploads folder that sends AI agents’ requests for the priced files — those files and no others — through WordPress. Apache and LiteSpeed read it from .htaccess — nothing to do. On nginx, add one block per file you sell inside the server block, and reload nginx:
Only a Media Library file with a price is ever sent through WordPress; a request for any other file there is answered 404, so the rule must name only files you gave a price.
Without the rule a paid file still has a paid address: /?p2flux_ap_file=<id>. Images inside a paid post are not paid unless you give them a price.
Who is asked to pay
An agent is recognised by an x402 payment on the request, by a bot signature, or by its user agent. The list can be changed with the p2flux_ap_agent_signatures filter.
Web Bot Auth is how an agent proves who it is: it signs each request and publishes its keys (ChatGPT agent does). When such an agent pays, the plugin checks the signature against the keys the agent publishes and shows the agent’s name next to the payment. A signature never makes anything free.
Pay per page and prepaid
Both are offered to every agent; it uses the one it supports. Prepaid can be switched off in the settings. One payment opens one page once: the same payment presented again is refused. An agent can ask for its unused prepaid balance back once it has used at least 0.10 USDC of it, or after 24 hours without use; unused balances also come back on their own after 7 days, and an agent can always withdraw from the escrow directly. What it already spent is yours.
Earnings
The settings page shows what agents paid today, this month and in all, and the last payments with a link to each transaction. Payments per page link to the transaction on Base; prepaid ones are marked prepaid until they are paid out.
Be found
“List my site in the P2Flux directory” is ticked by default. Listed: your site name, tagline, address, price, and the titles of your ten latest paid posts. Untick it and the listing is removed. Agents search the directory at GET /x402/directory.
Caches and CDNs
A cache that stores whole pages can answer an agent with a paid post before WordPress runs. Press Check my setup on the settings page: it opens your newest paid post the way a person does and then the way an AI agent does, through whatever stands in front of your site, and says whether the agent was asked to pay.
A default Cloudflare setup does not cache HTML pages and needs nothing.
Your own assistant
On WordPress 6.9 and later the plugin registers three abilities (the WordPress Abilities API), so an AI assistant you connected to your site — for example through the MCP Adapter plugin — can answer “what did AI agents pay me this month?” and “make this post cost 0.10”.
For plugin developers
From 0.5.0 a membership plugin can sell a period instead of one page — a subscription — on top of the paywall: it prices the page, says what the payment buys, grants the access when the payment settles and answers with an access token the agent sends back on later requests. Tipster Script does this for its predictions: a free pick costs the agent price, a locked pick is unlocked by the tipster’s subscription at the price people pay.
A worked example, a membership in one file. The three hooks price the page, say what the payment buys, and issue an access token when it settles:
- The agent sends tokens back in one P2Flux-Access-Token request header, separated by commas. P2Flux_AP_Gate::access_tokens() returns at most 10, each exactly 43 base64url characters; anything else is dropped. Store a hash, never the token.
- P2Flux-Access-Expires (a date such as 2026-11-01T23:59:59+00:00) is optional. The P2Flux MCP server keeps a token until then; without it, for one day.
- Every answer to an agent is sent with no-cache headers, pages also with Vary: User-Agent, PAYMENT-SIGNATURE, P2Flux-Access-Token, so a page opened by a token is not served to anyone else.
- Return null from p2flux_ap_price only for content you would show that agent anyway: the page is then served without payment.
The P2Flux MCP server (0.3.0 and later) keeps such tokens per site and sends them back only to that site.
Tipster Script
Tipster Script 2.0.48 and later sells predictions to AI agents through this plugin. People and their subscriptions are not affected.
- Install Agent Paywall (0.5.0 or later), save your wallet, and choose Test or Live.
- Its Price per request is what an agent pays for one free pick.
- Give each tipster a subscription plan priced in days with a USDC price — the plan’s own USDC price, or its price at your exchange rate. That is what agents pay for paid picks.
- Tipster Script settings, section AI agents: choose whether AI agents pay for free picks. Yes is the default.
A paid pick that is already open to visitors, after kickoff or its result, counts as a free pick.
A subscription bought by an agent is recorded like one bought by a person, under one user per paying wallet, so tipster earnings, subscriber counts and reports include it. The answer carries a P2Flux-Access-Token; an agent that sends it back reads every pick of that tipster until the end date without paying. A tipster with no USDC day plan has no paid picks for sale to agents.
In lists, feeds and archives an agent sees only the picks it paid for or holds a subscription for (and free picks, with the setting on No). For the others the selection, odds, stake and analysis are left blank.
Limits
- A bot that presents itself as an ordinary browser and does not sign its requests is not recognised and reads as a person does.
- A full-page cache or CDN that answers before WordPress runs can serve a paid post to an agent — see “Caches and CDNs”.
- Files are paid only when they have their own price, and on nginx only with the rule above.
- If P2Flux cannot be reached, agents are asked to come back later (or read free, if you chose so). People are never affected.
What is sent to P2Flux
- When an agent opens a paid page: your wallet address and the price.
- When an agent pays: your wallet address, the price, the page address and the agent’s payment.
- When you save the settings: your wallet address, and — if listed — your site address.
When an agent that signs its requests pays, the plugin reads that agent’s public keys from the agent’s own site, to check the signature. That request goes to the agent’s site, not to P2Flux.
Nothing about your human visitors is sent.