The easiest automatic analytics SDK for x402 payments
Project description
How to add it to your existing API (2 steps, < 2 minutes)
- Install the SDK in your project terminal:
pip install req402-sdk
- Open your main API file (e.g. main.py or app.py) and add these two lines:
from req402 import req402Middleware # add this import app = FastAPI() app.add_middleware(req402Middleware, api_key="your_key_here") # add this line
Full example of what your file should look like:
from fastapi import FastAPI
from req402 import req402Middleware # ← new
app = FastAPI()
app.add_middleware(req402Middleware, api_key="fk_your_key_from_dashboard") # ← new
@app.get("/")
def home():
return {"message": "My x402 API"}
@app.post("/api/chat")
def chat():
return {"response": "Paid response!"}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file req402_sdk-0.5.0.tar.gz.
File metadata
- Download URL: req402_sdk-0.5.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87132143166f46ca3511c331dd29ced347de46d01dcbb031bd09b3cbbfce0090
|
|
| MD5 |
5acf1064baa62d0298aa5219e3e9e1e1
|
|
| BLAKE2b-256 |
d4c8708a83bc99ea7b6da5ca84b98d5cbc468da6f6a5d4e051ebb23b66d85de4
|
Provenance
The following attestation bundles were made for req402_sdk-0.5.0.tar.gz:
Publisher:
publish.yml on req402/req402-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
req402_sdk-0.5.0.tar.gz -
Subject digest:
87132143166f46ca3511c331dd29ced347de46d01dcbb031bd09b3cbbfce0090 - Sigstore transparency entry: 813698125
- Sigstore integration time:
-
Permalink:
req402/req402-sdk@15c71a9bdafa69f6d06fb3d2a133a18b22c863eb -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/req402
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@15c71a9bdafa69f6d06fb3d2a133a18b22c863eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file req402_sdk-0.5.0-py3-none-any.whl.
File metadata
- Download URL: req402_sdk-0.5.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d81686042d6313612df8fb54257fd247e11117d9a28ca9aef0621acc0517cb19
|
|
| MD5 |
2a1a0ef9a4b79ca8c60832fb6e6385bc
|
|
| BLAKE2b-256 |
fe6c08635940448e2db1b55cc715f7fe22a82414bbb343c8f12b146d3d07d5f5
|
Provenance
The following attestation bundles were made for req402_sdk-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on req402/req402-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
req402_sdk-0.5.0-py3-none-any.whl -
Subject digest:
d81686042d6313612df8fb54257fd247e11117d9a28ca9aef0621acc0517cb19 - Sigstore transparency entry: 813698129
- Sigstore integration time:
-
Permalink:
req402/req402-sdk@15c71a9bdafa69f6d06fb3d2a133a18b22c863eb -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/req402
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@15c71a9bdafa69f6d06fb3d2a133a18b22c863eb -
Trigger Event:
push
-
Statement type: