Skip to main content
Cryptonly

Cryptonly — x402 facilitator

Accept x402 payments in Python, with Cryptonly as the facilitator.

Website · Documentation · Contact


Cryptonly verifies and settles each payment, and pays the network fee. Payments go straight to your wallet. This package plugs Cryptonly into the stock x402 middleware for FastAPI and Flask.

You need a Cryptonly API key with the x402.verify and x402.settle scopes. The quickstart covers getting one.

FastAPI

pip install cryptonly-x402 "x402[fastapi,evm]" fastapi uvicorn
import os

from cryptonly_x402 import CryptonlyFacilitatorClient
from fastapi import FastAPI
from x402.http import PaymentOption, RouteConfig
from x402.http.middleware.fastapi import PaymentMiddlewareASGI
from x402.mechanisms.evm.exact import ExactEvmServerScheme
from x402.server import x402ResourceServer

facilitator = CryptonlyFacilitatorClient(os.environ["CRYPTONLY_API_KEY"])
server = x402ResourceServer(facilitator)
server.register("eip155:8453", ExactEvmServerScheme())

routes = {
    "GET /weather/:city": RouteConfig(
        accepts=PaymentOption(scheme="exact", price="$0.01", network="eip155:8453", pay_to=os.environ["PAY_TO"]),
    ),
}

app = FastAPI()
app.add_middleware(PaymentMiddlewareASGI, routes=routes, server=server)


@app.get("/weather/{city}")
async def weather(city: str):
    return {"city": city, "temperatureC": 21}

PAY_TO must be a wallet you added in the dashboard.

Flask

Install x402[flask,evm] and use the sync classes:

import os

from cryptonly_x402 import CryptonlyFacilitatorClientSync
from x402.mechanisms.evm.exact import ExactEvmServerScheme
from x402.server import x402ResourceServerSync

facilitator = CryptonlyFacilitatorClientSync(os.environ["CRYPTONLY_API_KEY"])
server = x402ResourceServerSync(facilitator)
server.register("eip155:8453", ExactEvmServerScheme())

Sandbox

Pass sandbox=True and use a key from your sandbox account. The sandbox settles on Base Sepolia (eip155:84532) and Solana Devnet.

facilitator = CryptonlyFacilitatorClient(os.environ["CRYPTONLY_API_KEY"], sandbox=True)

Learn more

License

MIT

Metadata

Release files for cryptonly-x402 0.2.0

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

Source distribution (sdist)

Source distribution for cryptonly-x402 0.2.0
File Size Uploaded Provenance
cryptonly_x402-0.2.0.tar.gz 4.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cryptonly-x402 0.2.0
File Interpreter ABI Platform
cryptonly_x402-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / cryptonly_x402-0.2.0.tar.gz

Download URL cryptonly_x402-0.2.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d3672888565dd527b0f8343c93853aee70c09eaf3f968305cc169dd064d2d8f2
BLAKE2b-256 checksum
How to use checksums
2ce68307bbb2618c84263139fbee40ffdf9fd4dc4db80ca8a9122e92eb0d2df2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / cryptonly_x402-0.2.0-py3-none-any.whl

Download URL cryptonly_x402-0.2.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91a5f64cc4372383ed8be3a9f2528420bad899694a4adcc70f2c6579756d47d6
BLAKE2b-256 checksum
How to use checksums
8f19a64b79265e8aac53a3228b207042f966711621b9b2e248074748c5bedd33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for cryptonly-x402 0.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cryptonly_x402-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

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.

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