Integration guide

Two layers: a hosted script in <head> for human detection and in-browser payments, plus agentoll middleware on Node/Express for HTTP 402 on curl and agents.

Steps

StepAction
1 Join the waitlist at agentoll.net/waitlist
2 Enter domain, Base wallet address, and optional email — save your API key
3 Copy the embed snippet into <head> on your site
4 If you run Node/Express, npm install agentoll and mount middleware before routes

Browser embed — Layer 1

The hosted script tag detects humans, classifies bots, and runs the payment wall with wallet UX in the browser.

Replace pub_xxxxxxxx with your publisher ID from registration.

<script
  src="https://agentoll-middleware-p5aon.ondigitalocean.app/v1/agent-toll.js"
  data-publisher-id="pub_xxxxxxxx"
  async
></script>

Important notes

Verify the embed

Layer 2 — server gate The embed does not block curl at the HTTP layer. Mount agentoll on your Node server for HTTP 402 — see below.

Server gate — Layer 2

Node/Express middleware via the agentoll package. Returns HTTP 402 for curl and unpaid agents. Always pair with the browser embed — humans and paying agents need the in-browser wallet UX.

Express example

const express = require('express');
const { createGate } = require('agentoll');

const app = express();

app.use(
  createGate({
    apiKey: process.env.AGENTOLL_API_KEY,
    publicOrigin: 'https://www.example.com'
  }).express()
);

app.get('/article', (req, res) => {
  res.send('<html>...</html>');
});

app.listen(3000);

publicOrigin can be set to your registered public URL if it differs from the request host.

Verify with curl

curl -sI "https://www.example.com/article" -H "User-Agent: curl/8"

Expect: HTTP 402 with a payment-required header.

Behavior

ClientResult
Human browserPage served normally
curl / bot (unpaid)402 + payment-required header
Paid retry with payment-signature200 + session cookie

No DNS changes required. The server gate uses your API key with the hosted API — no self-hosted middleware.

Get your embed snippet and API key

Registration includes both the browser embed and server gate instructions.

Join waitlist Embed reference