> For the complete documentation index, see [llms.txt](https://docs.stripe402.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stripe402.com/readme.md).

# Introduction

An HTTP 402 payment protocol for API monetization using Stripe. Inspired by [x402](https://x402.org), but built on traditional credit card rails instead of blockchain settlement.

Clients and servers negotiate payment via HTTP headers. No signup, no API keys, no OAuth. A client with a credit card can pay for any stripe402-enabled API on the first request.

## What is stripe402?

stripe402 turns the HTTP 402 status code — reserved since 1997 but never standardized — into a practical payment protocol. When a client requests a paid resource, the server responds with 402 and a machine-readable description of the price and how to pay. The client tokenizes a card via Stripe, retries with a payment header, and the server charges the card, credits a balance, and serves the resource.

Subsequent requests use a client ID (derived from the card fingerprint) to deduct from the credit balance — no payment until credits run out.

## Features

* No signup, no API keys, no dashboards — the payment is the authentication
* Credit card payments via Stripe
* Sub-cent pricing via a credits system (1 unit = 1/10,000 of a dollar)
* AI agents can discover and pay for APIs without human setup
* Redis and PostgreSQL persistence backends included
* Express middleware included; framework-agnostic core makes it easy to add others

## Packages

| Package                   | Description                                                 |
| ------------------------- | ----------------------------------------------------------- |
| `@stripe402/core`         | Protocol types, header encoding, HMAC identity, error types |
| `@stripe402/server`       | Stripe integration, Redis and PostgreSQL stores             |
| `@stripe402/express`      | Express middleware for payment-gated routes                 |
| `@stripe402/client-axios` | Axios interceptor for automatic 402 handling                |
| `@stripe402/client-fetch` | Fetch wrapper for automatic 402 handling                    |

## Quick Links

* [Getting Started](/getting-started/getting-started.md) — install and run in 5 minutes
* [Protocol Overview](/protocol/protocol.md) — how the payment flow works
* [Package Reference](/packages/packages.md) — detailed API docs for each package
* [Guides](/guides/guides.md) — step-by-step tutorials
* [Configuration Reference](/reference/configuration.md) — all settings and options
