near testnet · http 402 · on-chain reputation
Stripe for AI agents
on NEAR.
NearGate turns any API into a paid x402 service in one command — machine-to-machine micropayments in native NEAR, with on-chain discovery and reputation. No cards, no KYC, no API keys.
$ one line after npm install -g @neargate/cli, with your NEAR account and its key (read from ~/.near-credentials). Or read the live on-chain catalog with no key: neargate list
live network stats · 5s poll
liveservices listed
paid calls attested
revenue settled
network
how it works
Wrap an API. Agents find it, pay it, and rate it — all on-chain.
Wrap
One command registers your API on the NEAR registry contract and drops a 402 paywall in front of it. No billing code, no accounts, no keys to issue.
neargate wrap <url> --price 0.5 --name <name> --account <you> --attestor <gateway account> --gateway <url>Discover
Agents read the on-chain catalog — price, endpoint, trust score — pick a service, and get an HTTP 402 invoice with a one-time payment nonce.
GET /svc/1 → 402 { maxAmountRequired, extra.nonce }Get paid
The agent calls the registry’s pay(service_id, nonce) with the price plus a 0.002 NEAR storage fee attached, then retries with the transaction hash as proof. Every served call writes a reputation attestation back on-chain.
200 OK · attestation recorded ✓Native HTTP semantics
The paywall speaks the web’s own “Payment Required” status — any agent that can fetch can pay.
True micropayments
Per-call pricing in NEAR, from 0.000001 NEAR up. No monthly plans — a buyer attaches the price plus a flat 0.002 NEAR storage fee per call.
Verifiable reputation
Every paid call leaves two on-chain transactions: the payment and the attestation that scores the service.
roadmap
What ships, and what is next.
- NOW · shipped
NEAR testnet · registry-settled x402
Buyers pay through the registry contract: the price goes straight to the seller, a flat 0.002 NEAR storage fee stays, and the payment is recorded on-chain so the gateway can verify it and attest the call. The CLI and an MCP server drive the whole loop.
- NOW · shipped
Prepaid escrow · restricted agent keys
An agent prepays an escrow in the registry and pays each call out of it with pay_from_escrow. Its key is a NEAR function-call key restricted to that one method: it can spend the escrow and nothing else, and the escrow is its spending limit. It can also burn gas from the account balance up to its allowance, so keep that low. Withdrawing needs the account’s full-access key.
- NOW · shipped
Gasless payments (NEP-366)
A buyer with a prepaid escrow signs its pay_from_escrow as a NEP-366 delegate, and the gateway relays it and pays the gas: the buyer’s account sends no transaction. The gateway relays that one zero-deposit call and nothing else, so it risks only gas; the payment still settles through the registry.
- LATER
More payment assets
NEP-141 token prices next to native NEAR. The registry already stores an accepts[] price list of up to four options per service.
get started
Wrap your first API in under five minutes.
$ npm install -g @neargate/cli
$ neargate wrap https://api.example.com/gold --price 0.5 --name "Gold Spot Feed" --account alice.testnet --attestor neargate-app-gateway.testnet --gateway https://neargate-gateway-production.up.railway.app
then open /catalog and watch agents find you.