Tollgate

Reference

API reference

All endpoints live under your gateway origin, for example https://gateway.tollgate402.com. Responses are JSON; amounts are decimal strings in USDG.

Endpoints

MethodPathDescriptionAuth
GET/.well-known/x402Route catalog with prices and session termsnone
GET|POST/x402/:routeGated route; 402 without payment, 200 with X-PAYMENTx402
POST/x402/sessionsOpen a prepaid session for a routex402
GET/x402/receipts/:nonceSettlement receipt for a paymentAPI key
GET/x402/statsGate hits, settlements and revenue countersnone
POST/vault/secretsStore or rotate a secretadmin
POST/vault/brokerMake an upstream call with secret substitutionAPI key
GET/agents/:idAgent wallet, spend and reputationAPI key
POST/rpcRead-only JSON-RPC proxy (eth_call, eth_getLogs, …)none

Authentication

Agent endpoints take Authorization: Bearer tg_live_…. Gated routes take X-PAYMENT, a base64-encoded signed PaymentIntent. Admin endpoints take the key set in TOLLGATE_ADMIN_KEY.

Receipt object

GET /x402/receipts/:nonce
{
  "nonce": "0x8f1c…e20b",
  "route": "/x402/premium",
  "amount": "0.01",
  "asset": "USDG",
  "payer": "0x3be1…07c4",
  "payTo": "0x7A3f92bE01c4D58aF6e3B27d90C1a4E58f2Dc21E",
  "network": "eip155:4663",
  "tx": "0x9c4f…a1d2",
  "block": 91016422,
  "settledAt": "2026-10-17T13:25:04Z",
  "latencyMs": 96
}

Errors

StatusCodeMeaning
402payment_requiredNo or invalid X-PAYMENT; body holds a fresh challenge
409nonce_replayedThis nonce was already settled
410intent_expiredThe PaymentIntent passed its validBefore
429rate_limitedPer-agent limit hit; see Retry-After
403vault_host_deniedSecret not allowed for this upstream host