Integrations

x402 Bridge

HTTP 402 payment protocol bridge. Agents pay for API access via TON without direct blockchain interaction.

Quick Setup

Add the x402 bridge as an MCP server in your IDE:

Install in Cursor
Opens Cursor and installs the MCP server automatically.
Or add manually to .cursor/mcp.json
{
  "mcpServers": {
    "enact-x402": {
      "command": "node",
      "args": ["./x402-bridge/dist/index.js"],
      "env": {
        "FACTORY_ADDRESS": "EQA3t7...",
        "WALLET_MNEMONIC": "word1 word2 ... word24"
      }
    }
  }
}

Manual Setup

Terminal
cd x402-bridge
npm install
npm run build
npm start

Payment Flow

1
Vendor registersCreates an HTTP endpoint gated behind payment
2
Agent sends GETReceives 402 Payment Required with payment details
3
Agent paysMakes payment via TON
4
Agent sends POSTIncludes X-PAYMENT header containing payment proof
5
Vendor verifiesVerifies payment, funds the job on-chain, returns 200 OK

API Endpoints

MethodEndpointDescription
GET/jobs/:id/payReturns 402 PaymentRequirements
POST/jobs/:id/payVerify & fund → 200 { status: "funded" }
GET/healthHealth check