Setup Guide

Integrate Pulse into your x402 endpoint in under 2 minutes. Three ways: middleware, MCP server, or direct API.

Middleware Integration

Recommended
1

Install

npm install @kyvernlabs/pulse @x402/core @x402/next @x402/evm
2

Wrap your handler

import { withX402 } from '@x402/next'
import { withPulse } from '@kyvernlabs/pulse'

// Your x402 handler — Pulse captures every payment
const x402Handler = withX402(handler, {
  accepts: { scheme: 'exact', price: '$0.01',
             network: 'eip155:8453', payTo: '0x...' }
}, server)

// One line — that's the entire integration
export const GET = withPulse(x402Handler, {
  apiKey: 'kv_live_your_key_here'
})
3

See your revenue

Every x402 payment is now captured with blockchain tx hash. Head to the dashboard to see revenue, customers, and performance in real time.

MCP Server — for AI Agents

New

Let AI agents (Claude, GPT, Cursor) query your x402 analytics directly. The MCP server exposes your Pulse data as tools any LLM can call.

Install globally

npm install -g @kyvernlabs/mcp

Add to Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "kyvernlabs-pulse": {
      "command": "npx",
      "args": ["@kyvernlabs/mcp"],
      "env": {
        "KYVERNLABS_API_KEY": "kv_live_your_key_here"
      }
    }
  }
}

Available tools

ToolDescription
pulse_get_statsRevenue, calls, customers with deltas
pulse_get_endpointsPer-endpoint revenue and latency
pulse_get_customersTop paying agent wallets
pulse_get_transactionsRecent payments with tx hashes
pulse_get_timeseriesRevenue over time for charting
pulse_ingest_eventRecord an x402 payment event

Example prompts

What's my x402 revenue this week?

Which endpoints are making the most money?

Show me my top 5 paying agents

How many verified payments did I get today?

Direct API

Send events directly to the Pulse ingest API from any language or framework.

curl -X POST https://kyvernlabs.com/api/pulse/ingest \
  -H "Content-Type: application/json" \
  -H "X-API-Key: kv_live_your_key_here" \
  -d '{
    "endpoint": "/api/your-service",
    "amount_usd": 0.01,
    "payer_address": "0x...",
    "tx_hash": "0x...",
    "network": "eip155:8453",
    "status": "success"
  }'

What Pulse tracks per transaction

Endpoint path

Which API was called

Payment amount

USD value of x402 payment

Payer address

Agent wallet that paid

Response latency

Time to process the request

Tx hash

Blockchain transaction proof

Network

Which chain (Base, Ethereum, etc.)

Your API Key

Connect your wallet to get your kv_live_ API key.

kv_live_your_key_here