Skip to content

v0.8.0

Choose a tag to compare

@modulout modulout released this 02 Oct 16:33
· 29 commits to main since this release

Added

  • x402 paywall — charge AI agents for a page or an API route without an x402 library:
    P2Flux\Paywall (guard($paymentHeader, $url, $userAgent)), and the two calls under it,
    P2FluxClient::paywallChallenge() and paywallRedeem(). Pay-per-request and prepaid balance; the
    payment is settled before anything is served and serves one response. examples/paywall.php.
  • Usage pricing — Paywall::usage($paymentHeader, $url, $maxPrice, $work) and
    P2FluxClient::paywallVerify(): the agent signs for at most $maxPrice (x402 upto), you charge
    what the request cost (paywallRedeem(..., $amount)).
  • Requests signed as bots (Web Bot Auth) count as agents under agentsOnly (guard(..., ['signed' => true]));
    an agent's prepaid refund request is answered with its receipt.
    Nothing else changed.