Tollgate

Agents

Install the agent skill

The skill teaches an agent the x402 loop: list paid routes, read the challenge, ask you, pay, replay. It works in Claude Code, Cursor and any runtime that loads SKILL.md files.

Install

project root
git clone https://git.tollgate402.com/tollgate/gateway.git tollgate
mkdir -p .claude/skills/tollgate-x402
cp tollgate/skill/SKILL.md .claude/skills/tollgate-x402/
echo "TOLLGATE_URL=https://gateway.tollgate402.com" >> .env

Restart the agent session. The skill registers three tools and stays dormant until a task mentions a paid API or a request returns 402.

Tools the agent gets

ToolWhat it doesSpends?
x402_discoverReads /.well-known/x402 and returns routes, prices and session termsNo
x402_quoteCalls a route without payment and parses the 402 challengeNo
x402_paySigns the PaymentIntent after approval, settles and replaysYes, capped

Approval and spend caps

x402_pay never runs silently. The agent shows the route, price and expiry and waits for an explicit yes. You can pre-approve small amounts per session:

.env
# approve automatically up to this much per session
TOLLGATE_AUTO_APPROVE_MAX=0.05
# hard cap per day, enforced by the gateway too
TOLLGATE_DAILY_CAP=5.00
TOLLGATE_API_KEY=tg_live_3f9a1c07e2b84d6a59c1e0f7ab42

A typical exchange

  • You ask for a pre-market brief. The agent calls x402_discover and finds /x402/premium at 0.01 USDG.
  • It calls x402_quote, gets the challenge and asks: “Pay 0.01 USDG for /x402/premium?”
  • You approve. x402_pay settles on Robinhood Chain and returns the payload plus the tx hash.