Ready to build the future of programmatic payments and agentic commerce? This guide covers how to quickly get started building with x402, an open payment protocol that enables instant, automatic stablecoin payments directly over HTTP. We’ll show you how to monetize APIs, enable AI agents to pay for services, and create frictionless payment experiences.

x402 Overview

x402 is a new open payment protocol developed by Coinbase that revives the HTTP 402 Payment Required status code to enable instant, programmatic stablecoin payments. Think of it as bringing native payments to the internet - no accounts, no API keys, just pay and access. Key capabilities:
  • Instant Micropayments: Pay-per-request APIs with USDC on Base (fee-free!)
  • Agent-Native Payments: AI agents can autonomously discover and pay for services
  • No Authentication Required: No API keys, accounts, or complex auth flows
  • Simple Integration: Add payments to any HTTP endpoint with minimal code
  • 🆕 Discovery Layer (x402 Bazaar): Agents can find and use services programmatically - learn more

Getting Started

Quick Start Options

  1. For Sellers (Monetize Your API)
  2. For Buyers (Build Payment-Enabled Agents)
  3. MCP Server Integration
    • Build Model Context Protocol servers that can pay for services
    • See our MCP Server guide for Claude Desktop integration
    • Check the MCP example in our repo
  4. Discover Services with x402 Bazaar
    • Use the new x402 Bazaar to programmatically discover available x402 services
    • Perfect for building agents that can autonomously find and use new capabilities
    • No need to hardcode endpoints - let your agents discover services dynamically!
  5. Miniapps with Payments

Development Tools

Integration with CDP Products

x402 works seamlessly with other Coinbase Developer Platform products:
  • CDP Wallets: Use Server Wallets for agent payments or Embedded Wallets for user-facing apps
  • AgentKit: Create AI agents that can autonomously pay for services
  • Onramp: Enable users to fund their wallets to pay for x402 services

Project Ideas

AI Agent Projects

Financially Autonomous Agent Build an agent that becomes truly financially independent. Give it the ability to:
  • Access the x402 Bazaar to dynamically discover and use new services
  • Post on social platforms to build its reputation
  • Create and post bounties for tasks it needs completed
  • Self-improve by purchasing new tools and capabilities via x402
  • Bonus: Allow the agent to restart itself with expanded capabilities learned from the Bazaar
Self-Improving Agent Create an agent that progressively enhances itself:
  • Starts with basic capabilities
  • Discovers new tools available via the x402 Bazaar
  • Purchases and integrates new tools autonomously
  • Builds its own website showcasing learned capabilities
  • Restarts with more tools and improved functionality from the Bazaar ecosystem
Hybrid Intelligence Agent Build an agent that intelligently manages compute resources:
  • Uses a local model for routine decisions
  • Automatically outsources to Hyperbolic’s x402 API for complex reasoning
  • Optimizes cost vs. performance dynamically
  • Tracks spending and adjusts strategy based on results
AI Code Review Agent Deploy a Claude Code instance (or similar) as a service:
  • Accessible via x402 for a set price per review
  • Performs code reviews, bug fixes, or PR analysis
  • No subscription or API key required - pure pay-per-use
  • Could integrate with GitHub webhooks for automatic reviews
Bounty-Posting Agent Create an agent that acts as a project manager:
  • Posts bounties for various tasks using x402 payments
  • Verifies completed work and releases payments
  • Learns from completed tasks to post better bounties
  • Could manage entire projects autonomously

Infrastructure & Tools

Endpoint Wrapping Take existing APIs and make them x402-compatible:
  • Wrap non-x402 endpoints to enable pay-per-use access
  • Priority targets:
    • Browser/Computer Use APIs
    • GPU Compute services
    • Data storage/retrieval endpoints
    • LLM inference APIs
  • Create a marketplace of wrapped endpoints
  • Note: Some of these services already exist (https://mcpay.fun , https://www.monetizedmcp.org/), and you can use them to build wrapped endpoints.
Payment Splitting System Develop mechanisms for sharing x402 payments:
  • Split payments between creators and publishers
  • Revenue sharing for agent-tool ecosystems
  • Integration with @0xSplits or similar protocols
  • Transparent, onchain payment distribution
Swarm Task Router Build a decentralized task marketplace:
  • Break complex jobs into microtasks
  • Any agent can claim and complete tasks for x402 bounties
  • Automatic task verification and payment release
  • Reputation system for reliable agents

Commerce & Consumer Apps

Monetized Miniapps Use x402 to build frictionless payment experiences:
  • No signup or authentication required
  • Users pay-as-they-go for features
  • Deploy in Farcaster/TBA for distribution
  • See remixme.xyz for inspiration
AI Agent in the Base app Create an agent that lives in Base:
  • Uses x402 to pay for external services
  • Exposes capabilities to end users
  • Natural language interface for complex tasks
  • Could be a personal assistant, researcher, or trader
Agentic Commerce Platform Enable agents to purchase real goods:
  • Integration with AEON or Crossmint for physical goods
  • x402 for instant payment processing
  • Agent negotiation and price discovery
  • Autonomous supply chain management
Telegram Bot Ecosystem Build payment-enabled Telegram bots:
  • Use x402 for monetization without complex billing
  • Distribute through Telegram’s massive user base
  • Bonus: Make it work across Telegram, MCP, and other platforms
  • Could be games, tools, or content generators

Protocol Improvements

x402 Spec Enhancements Work with our engineering team to extend the protocol:
  • Support for arbitrary tokens beyond USDC
  • Multi-network payment routing
  • New payment schemes (subscriptions, auctions, etc.)
  • Credit-based billing systems
  • Enhanced discovery mechanisms

Getting Help

We’re here to help you succeed with x402:
  • Get started with x402 implementation
  • Review your architecture and approach
  • Provide test USDC for Base Sepolia
  • Answer any technical questions
  • Get your feedback on the protocol
Reach out on Discord in the #x402 channel.

Tips for Success

  1. Start Simple: Begin with a basic x402 integration, then add complexity
  2. Use Our Examples: The x402 repo has complete examples for common use cases
  3. Think Agent-First: Design your services to be discoverable and usable by AI agents
  4. Leverage Existing Tools: Combine x402 with AgentKit or embedded wallets for powerful experiences
  5. Test on Sepolia First: Use Base Sepolia for development, then deploy to mainnet
  6. Document Your API: Make it easy for agents and developers to understand your endpoints

Building with x402

Let’s bring programmatic payments to the internet and enable the next generation of autonomous agents. We can’t wait to see what you build!