Documentation

Documentation

Welcome to OpenUSDC. The gateway is open-source middleware that speaks the x402 standard; the SDKs let your agents pay any x402 endpoint in USDC. Start with the Quickstart, then dig into the API reference and language-specific SDK guides.

Get started in 5 minutes

The fastest way to see OpenUSDC in action is to run the gateway locally with the deterministic sandbox chain, then hit it from any HTTP client. The Quickstart walks you through it end-to-end.

# Install the CLI
npm i -g @openusdc/cli

# Run the gateway in sandbox mode
openusdc dev --chain sandbox --route POST:/echo --price "0.0010 USDC"

# In another terminal:
openusdc fetch POST http://localhost:7202/echo --max-spend "0.01 USDC"

Within seconds you should see a signed payment receipt printed to stdout. From there it's a small step to swap --chain sandbox for --chain base with a real USDC-funded wallet.

Concepts

The x402 standard

HTTP 402 has lived in the spec since the 90s as the "Payment Required" response. The x402 payment standard formalizes how a server quotes a price and how a client pays it — using a small set of HTTP headers and a stablecoin settlement.

The gateway

The OpenUSDC gateway is a middleware layer for Node, Python, Go, Rust, Deno, and Cloudflare Workers. It intercepts requests to a priced route, returns a 402 with the price quote when payment is missing, validates payment headers, settles on-chain, and forwards the request to your handler with a signed receipt attached.

The SDK

The OpenUSDC SDK is what an agent (or a plain client) uses to pay. It wraps a wallet, signs x402 payment headers, retries 402 responses automatically, and emits structured receipts your code can persist alongside business state.

OpenUSDC Cloud

Cloud is the optional hosted control plane — the dashboard, webhook fanout, reconciliation ledger, alerts, and exports. It is wire-compatible with the self-hosted gateway and entirely opt-in.

Pick a path

Where to start depends on which side of the request you sit on.

Resources

  • GitHub — gateway, SDKs, examples, and audit reports
  • Discord — community support and roadmap discussion
  • Changelog — what shipped, when
  • Security — audits, disclosure, and SOC 2 status