> ## Documentation Index
> Fetch the complete documentation index at: https://shinydapps-bd9fa40b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ?????

> Bitcoin sats ??? ???? API ?? ??? ????? ???? ?? ???? ??? ??????

## l402-kit ???? ???

**l402-kit** ?? open-source middleware ?? ?? ???? ?? ?????? ?? 3 ???? ??? ??? ???? API ??? Bitcoin Lightning micropayments ?????? ???? ???

??? ??????? ????? ????? ??? ??????????? ????? ??? chargeback ????? ??? minimum fee ????? ????? sats?

```bash theme={null}
npm install l402-kit   # TypeScript / Express
pip install l402kit    # Python / FastAPI / Flask
go get github.com/shinydapps/l402-kit/go@v1.10.0  # Go / net/http
cargo add l402kit       # Rust / axum
```

## ?? ??? ?????? ?? ?? ???? ???

* **Stripe**: ????? transaction minimum \$0.30 � micropayments ?? ??? ?????
* **Subscriptions**: ?? ?????????? ?????? ???????????? ?? subsidize ???? ???
* **AI Agents**: credit card ???? ?? � APIs ?? automatically pay ???? ?? ????

**l402-kit** ????? ?????? ??: Lightning Network ?? ???? pay-per-call, 1 second ?? ?? ??? global settlement?

## ?? ????? ??? ???

* **API Developers** � monthly subscription ?? ??? per-call charge ????
* **AI Agent Builders** � agents automatically APIs pay ???? ???
* **Stripe ?? ???? Devs** � India, Bitcoin ?? ??? ???? ????

## ?????? ?????? � TypeScript

```typescript theme={null}
import express from "express";
import { l402 } from "l402-kit";

const app = express();

app.get("/premium", l402({
  priceSats: 100,                           // ~?5 ????? call
  lightning: new AlbyProvider(process.env.ALBY_TOKEN!, process.env.ALBY_HUB_URL!),    // ??????? ??? � 0% ?????
}), (_req, res) => {
  res.json({ data: "?????? ?????????." });
});

app.listen(3000);
```

## ?????? ?????? � Python

```python theme={null}
from fastapi import FastAPI, Request
from l402kit import l402_required

app = FastAPI()

@app.get("/premium")
@l402_required(
    price_sats=100,
    lightning=ManagedProvider.from_address("you@blink.sv"),
)
async def premium(request: Request):
    return {"data": "?????? ?????????."}
```

## ??? ????? ????

```bash theme={null}
curl http://localhost:3000/premium
# ? {"error":"Payment Required","priceSats":100,"invoice":"lnbc..."}
```

<Card title="???? Quickstart" icon="bolt" href="https://l402kit.com/docs/quickstart">
  5 ???? ??? paid API ???? ????
</Card>
