Demo Playground

Watch the x402 payment flow in action

Configuration

Loading services...

SDK Code

const agent = new AgentXPayClient({
  rpcUrl: "http://127.0.0.1:8545",
  privateKey: AGENT_KEY,
});

const res = await agent.fetch(
  "https://ai-service.com/api/chat",
  {
    method: "POST",
    body: JSON.stringify({
      prompt: "Explain how AI agents can use ..."
    }),
    autoPayment: true,
  }
);

x402 Payment Flow

Click "Send Request" to start the demo

AI Response

Response will appear here