Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

swiftpay-x402-fastapi-guard

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

Installation

pip install swiftpay-x402-fastapi-guard

Quick start

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.

Metadata

Release files for swiftpay-x402-fastapi-guard 0.1.1b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swiftpay-x402-fastapi-guard 0.1.1b0
File Size Uploaded Provenance Actions
swiftpay_x402_fastapi_guard-0.1.1b0.tar.gz 8.5 kB Without provenance Details for swiftpay_x402_fastapi_guard-0.1.1b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swiftpay-x402-fastapi-guard 0.1.1b0
File Interpreter ABI Platform Actions
swiftpay_x402_fastapi_guard-0.1.1b0-py3-none-any.whl Python 3 none any Details for swiftpay_x402_fastapi_guard-0.1.1b0-py3-none-any.whl

Total release size: 16.6 kB

Release files / swiftpay_x402_fastapi_guard-0.1.1b0.tar.gz

Download URL swiftpay_x402_fastapi_guard-0.1.1b0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b69df70046c89f61b7db72a3022ea5823b9cffd20036209c72b8b5e1a63354f3
BLAKE2b-256 checksum
How to use checksums
54e1226ad1e4f2e19d5b3c97abebeec8a3cd67dd5155bc826fb11f50610a944d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / swiftpay_x402_fastapi_guard-0.1.1b0-py3-none-any.whl

Download URL swiftpay_x402_fastapi_guard-0.1.1b0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43feb564be382b39c71a0bf887dc83bca315468484075fa6b0658845eab68e52
BLAKE2b-256 checksum
How to use checksums
bcf11aedff135c6dff4abbaa5700018f649ff19850bd988448c967130f5cd4d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for swiftpay-x402-fastapi-guard 0.1.1b0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page