Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.myproceeds.xyz/llms.txt

Use this file to discover all available pages before exploring further.

x402 is the open payment standard built on the HTTP 402 Payment Required status code. It lets clients pay programmatically for API access without accounts, sessions, or API keys. Every Proceeds paywall exposes an x402 URL. Use x402 when you want broad client compatibility — any x402-aware library or agent will work.

Endpoint

https://myproceeds.xyz/api/x402/pay/{serviceId}/{slug}

Flow

  1. Client requests the x402 URL.
  2. Proceeds responds with 402 Payment Required and a challenge.
  3. Client signs an EIP-3009 USDC payment authorization.
  4. Client retries with the authorization in the X-Payment header.
  5. Proceeds verifies and proxies the upstream response.

curl

curl -i https://myproceeds.xyz/api/x402/pay/{serviceId}/{slug}

JavaScript

A wallet-aware client signs the EIP-3009 authorization and retries automatically.
import { createUSDCPaymentFetch } from '@/lib/usdc-payment-client'
import { useWallets } from '@privy-io/react-auth'
import { createWalletClient, custom } from 'viem'

const { wallets } = useWallets()
const wallet = wallets[0]
const provider = await wallet.getEthereumProvider()

const walletClient = createWalletClient({
  account: wallet.address,
  transport: custom(provider),
})

const usdcFetch = createUSDCPaymentFetch(walletClient, BigInt(100000000))

const response = await usdcFetch(
  'https://myproceeds.xyz/api/x402/pay/{serviceId}/{slug}'
)

const data = await response.json()

React

A drop-in component that renders the result after payment is confirmed.
import { X402PaymentClient } from '@/components/X402PaymentClient'

function MyComponent() {
  return (
    <X402PaymentClient
      resourceUrl="https://myproceeds.xyz/api/x402/pay/{serviceId}/{slug}"
      onSuccess={(content) => console.log('Content:', content)}
      onError={(error) => console.error('Failed:', error)}
    />
  )
}

When to use x402

  • You want broadest client compatibility.
  • Your buyers are humans or apps with wallets, not Tempo-native agents.
  • Sub-cent pricing isn’t required — for that, layer in Circle Nanopayments.

More on x402

Read the open standard at docs.x402.org.