Skip to main content

What is x402?

x402 is an open HTTP payment protocol backed by Coinbase, Cloudflare, Google, Visa, Stellar, and Lightning Labs. It enables pay-per-request APIs where clients pay with crypto before accessing a resource. The protocol uses HTTP status code 402 Payment Required — a status code reserved since 1997 for exactly this purpose.

How it Works

  1. Client requests a protected resource
  2. Server returns 402 with a PAYMENT-REQUIRED header containing the price
  3. Client signs a USDC payment using SNIP-12 typed data
  4. Client retries the request with the signed payment in the X-PAYMENT header
  5. Server verifies the signature and settles via Chipi’s gasless paymaster
  6. Server returns the resource

Why x402 + Chipi?

Chipi’s existing infrastructure maps perfectly to x402: Key advantages:
  • Gasless: Payments are settled through Chipi’s paymaster — users never need STRK for gas
  • Session keys: Combined with SNIP-9 sessions, payments happen automatically without user interaction per request
  • Native USDC: All payments use native USDC on Starknet mainnet

SDK Support

Quick Examples

Client: Pay for APIs

Server: Monetize APIs

Next Steps

Client Guide

Pay for APIs from your app

Server Guide

Monetize your API endpoints

Session Keys

Automated payments with sessions