What Is the x402 Protocol
x402 is an HTTP-native payment protocol that uses USDC stablecoins for signupless, programmatic access to APIs and services. It implements HTTP status code 402 (Payment Required) with on-chain USDC payments on Base and Solana. osModa uses x402 to allow server spawning without signup or credit cards.
How x402 Works
The x402 protocol follows a challenge-response pattern built on standard HTTP. A client makes a request to a protected endpoint. The server responds with HTTP 402 (Payment Required) and includes payment instructions in the response headers: the amount of USDC required, the recipient address, and the supported blockchain networks.
The client completes the USDC payment on-chain (either on Base or Solana), receives a transaction hash as proof, and resubmits the original request with the transaction hash included in the request headers. The server verifies the on-chain payment and fulfills the request. No account was created. No personal information was exchanged. The payment is the authentication.
Why USDC Instead of ETH or SOL
USDC is a stablecoin pegged 1:1 to the US dollar. Using USDC eliminates price volatility: when osModa's Solo plan costs $14.99/month, that is 14.99 USDC regardless of what ETH or SOL are trading at. This makes pricing predictable for both the service provider and the customer.
osModa supports USDC on two networks: Base, an Ethereum Layer 2 with low gas fees and Ethereum ecosystem compatibility, and Solana, which offers sub-second finality and extremely low transaction costs. Users choose whichever network they prefer or already have funds on.
x402 on osModa: Signupless Server Spawning
osModa uses x402 to offer a zero-friction path to infrastructure. A user visits spawn.os.moda, selects a plan (Solo $14.99, Pro $34.99, Team $62.99, or Scale $125.99), chooses a region (Frankfurt, Helsinki, Virginia, or Oregon), and pays with USDC. No email, no password, no credit card form. The server is provisioned after on-chain payment confirmation.
This is particularly relevant for AI agents that need to provision their own infrastructure. An agent running on osModa can use osmoda-keyd (the wallet daemon with ETH + SOL support and policy-gated signing) to programmatically pay for additional servers via x402. The agent decides it needs more compute, sends USDC, and gets a new server -- all without human intervention.
osmoda-keyd: Agent Wallet Management
osmoda-keyd is one of osModa's 9 Rust daemons, responsible for managing ETH and SOL wallets with policy-gated signing. It enables AI agents to hold and spend USDC programmatically while maintaining security through configurable policies.
- Policy-gated signing -- Define rules for what transactions an agent can sign: maximum amounts, allowed recipients, required approval chains, and time-based limits.
- Dual-chain support -- ETH wallets for Base transactions and SOL wallets for Solana transactions. Both can hold and spend USDC.
- Audit integration -- Every wallet operation (balance check, transaction signing, payment confirmation) is recorded in the SHA-256 hash-chained audit ledger.
- Trust tier enforcement -- Wallet access is governed by the platform's trust model (Tier 0 unrestricted, Tier 1 sandboxed, Tier 2 max isolation). Untrusted agents cannot access wallet functions.
The History of HTTP 402
HTTP status code 402 was included in the original HTTP/1.1 specification (RFC 2616, published in 1999) with the note "reserved for future use." The designers of HTTP anticipated that the web would eventually need a native payment mechanism, but no standard emerged for over two decades. The x402 protocol fills this gap using stablecoins and blockchain verification instead of the traditional payment card infrastructure that the original designers may have envisioned.
Frequently Asked Questions
What does x402 stand for?
x402 references HTTP status code 402 (Payment Required), which was reserved in the HTTP specification but never standardized. The x402 protocol provides a concrete implementation: when a server returns a 402 status, the response includes payment instructions (amount, token, chain, recipient address). The client completes payment on-chain and resubmits the request with a payment proof. No signup, no API key, no account creation.
What is USDC?
USDC (USD Coin) is a stablecoin pegged 1:1 to the US dollar. It runs on multiple blockchains including Base (an Ethereum L2) and Solana. Because USDC maintains a stable value relative to the dollar, it eliminates the volatility risk of using native cryptocurrencies like ETH or SOL for payments. Prices in USDC are predictable -- $14.99 in USDC is always $14.99.
How does osModa use x402?
osModa accepts x402 USDC payments on both Base and Solana networks for server spawning. A user can spawn a dedicated server without creating an account, without entering an email, and without providing a credit card. They send USDC to the payment address, the transaction is verified on-chain, and the server is provisioned. This is the no-signup path to osModa infrastructure.
Why not just use credit cards?
osModa supports both traditional payment methods and x402 USDC. The x402 path exists for users who want signupless access: no account creation, no personal information, no payment processor intermediary. It also enables AI agents to programmatically pay for infrastructure using on-chain wallets (osmoda-keyd manages ETH and SOL wallets with policy-gated signing), which is not possible with credit cards.
What blockchains does osModa support for x402?
osModa supports x402 payments on Base (an Ethereum Layer 2 network with low transaction fees) and Solana (a high-throughput chain with sub-second finality). Both networks use USDC as the payment token. Base provides Ethereum ecosystem compatibility, while Solana offers faster confirmation times.
Can AI agents use x402 to pay for services?
Yes. This is one of the key use cases for x402 on osModa. An agent running on osModa can use osmoda-keyd (the wallet daemon) to sign USDC transactions and pay for external x402-enabled services programmatically. The wallet operations are governed by policy-gated signing, so you can set spending limits, approve specific recipients, and require multi-step authorization for large transactions.
Spawn a Server with USDC
No signup required. Pay with USDC on Base or Solana and get a dedicated server in seconds. Plans from $14.99/month.
Spawn Server