Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

x402 REST API - Python

This is the Python implementation of the x402 REST API sample using FastAPI.

Requirements

  • Python 3.10+
  • uv package manager
  • make
  • Stripe account with crypto payments enabled
  • EVM wallet with testnet USDC

Setup

  1. Configure environment variables:
cp ../../../.env.template .env
# Edit .env with your credentials
  1. Install dependencies:
make install

Run the server

  • make run — start the local sample server
make run

Development commands

  • make lint — run lint and formatting checks without changing files
  • make format — apply automatic formatting fixes
  • make typecheck — run the sample's type checker or build validation
  • make test — run the automated test suite
  • make ci — run the full local CI sequence (install, lint, typecheck, and test)
make lint
make format
make typecheck
make test
make ci

Test the sample

purl http://localhost:4242/paid