Skip to main content

The easiest automatic analytics SDK for x402 payments

Project description

How to add it to your existing API (2 steps, < 2 minutes)

  1. Install the SDK in your project terminal:
    pip install req402-sdk
    
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

req402_sdk-0.5.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

req402_sdk-0.5.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

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

Hashes for req402_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 87132143166f46ca3511c331dd29ced347de46d01dcbb031bd09b3cbbfce0090
MD5 5acf1064baa62d0298aa5219e3e9e1e1
BLAKE2b-256 d4c8708a83bc99ea7b6da5ca84b98d5cbc468da6f6a5d4e051ebb23b66d85de4

See more details on using hashes here.

Provenance

The following attestation bundles were made for req402_sdk-0.5.0.tar.gz:

Publisher: publish.yml on req402/req402-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for req402_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d81686042d6313612df8fb54257fd247e11117d9a28ca9aef0621acc0517cb19
MD5 2a1a0ef9a4b79ca8c60832fb6e6385bc
BLAKE2b-256 fe6c08635940448e2db1b55cc715f7fe22a82414bbb343c8f12b146d3d07d5f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for req402_sdk-0.5.0-py3-none-any.whl:

Publisher: publish.yml on req402/req402-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page