Metadata-Version: 2.4
Name: swiftpay-x402-fastapi-guard
Version: 0.1.1b0
Summary: x402 payment middleware for FastAPI — powered by the SwiftPay API
Project-URL: Homepage, https://docs.swiftpay.finance
Project-URL: Documentation, https://docs.swiftpay.finance/x402
Project-URL: Repository, https://github.com/swiftpayfi/sdk
Project-URL: Issues, https://github.com/swiftpayfi/sdk/issues
Project-URL: Changelog, https://github.com/swiftpayfi/sdk/blob/main/sdk/x402-fastapi-guard/CHANGELOG.md
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: fastapi,http-402,middleware,payment,stablecoin,swiftpay,usdc,x402
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.100
Requires-Dist: swiftpay-api-client>=0.1.0
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pydantic>=2.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# swiftpay-x402-fastapi-guard

x402 payment middleware for FastAPI — powered by the SwiftPay API.

## Installation

```bash
pip install swiftpay-x402-fastapi-guard
```

## Quick start

```python
from fastapi import FastAPI
from swiftpay import AsyncSwiftPay
from swiftpay_x402_fastapi_guard import X402Guard

client = AsyncSwiftPay(secret_key="sk_live_...")

app = FastAPI()
app.add_middleware(
    X402Guard,
    client=client,
    routes={"/v1/analyze": "https://api.example.com/v1/analyze"},
)

@app.get("/v1/analyze")
async def analyze():
    return {"sentiment": "positive", "score": 0.87}
```

Routes not listed in `routes` pass through unaffected.
