Catalog PyPI
PACKAGE EXPLORERView in registry

4mica-x402

PyPI

Python integration for x402 Payment Protocol with 4mica credit flow

Versions collected1
Direct dependencies10From release 1.2.3
Last observed20 Oct, 16:00 UTC

README

Version 1.2.3 documentation

4mica-x402

Python integration for the x402 Payment Protocol with 4mica credit flow support.

Install

pip install 4mica-x402

Optional extras:

  • fastapi (FastAPI middleware)
  • flask (Flask middleware)
  • httpx (async HTTP client wrapper)
  • requests (sync HTTP client wrapper)
  • all (everything)

Quick Start (Server)

from fastapi import FastAPI
from fourmica_x402.http import fastapi_payment_middleware_from_config

app = FastAPI()

routes = {
    "GET /premium": {
        "accepts": {
            "scheme": "4mica-credit",
            "price": "$0.01",
            "network": "eip155:11155111",
            "payTo": "0xRecipient",
        }
    }
}

middleware = fastapi_payment_middleware_from_config(
    routes,
    tab_endpoint="https://api.example.com/payment/tab",
)

@app.middleware("http")
async def x402_mw(request, call_next):
    return await middleware(request, call_next)

Quick Start (Client)

from x402 import x402ClientSync
from x402.http.clients import x402_requests
from fourmica_x402.client_scheme import FourMicaEvmScheme

client = x402ClientSync()
client.register("eip155:11155111", FourMicaEvmScheme("0xYourPrivateKey"))

session = x402_requests(client)
resp = session.get("https://api.example.com/premium")
print(resp.status_code, resp.text)

Development

python -m build
python -m pytest

Install dev tools:

pip install -e .[dev]

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.2.319 May 202610

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

MOVED
4mica-network/x402-4mica

Shared repository data · GitHub

Repository moved · manual review pending

HTTP 301 · detected 20 Oct 2026

Reported destination
License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:00 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c9d9ecd410bbfc72f9c917dce4fe80dab3176e329455da6b1bea9a5655632ad4