Choose your path
Start with the machine-commerce outcome you need to deliver.
Lucid turns typed TypeScript capabilities into paid services. Start with the economic role your application plays; you can add the other side later.
Understand where Lucid fits
Choose between the application runtime, an upstream protocol SDK, and provider infrastructure.
Sell a paid API
Define a priced capability, observe its x402 challenge, and complete a testnet payment.
Build a budgeted buyer
Give an application a wallet while keeping recipients and spend within policy.
Add Lucid to an existing app
Keep Hono, Express, Next.js, or TanStack Start and add one shared runtime.
Prepare for production
Choose storage, secrets, a facilitator, observability, and deployment controls.
The commercial loop
- A seller defines a typed capability. In the SDK, its definition is an
entrypoint. - Lucid publishes HTTP and Agent Card discovery metadata from that definition.
- An unpaid request receives an x402
402 Payment Requiredchallenge. - A buyer checks its policy, signs the accepted payment, and retries.
- Lucid verifies the payment, runs fulfillment, settles, and records the result.
Lucid owns the application transaction around the payment rail. It does not replace wallets, facilitators, networks, or the x402 protocol.
If you only need a route-level paywall, the official x402 middleware may be the smaller choice. Read When to use Lucid for the decision boundary.
Stable and Next
Stable examples install public npm releases. Next pages document the newer workspace surface in this repository and say so visibly. Read release channels before mixing examples from the two channels.