OpenRelay Python SDK — the open payment network
Project description
openrelay — Python SDK
The OpenRelay Python SDK — Stripe-compatible payments for the open web. Accept USDC on Base with no gatekeepers: gasless settlement (ERC-3009), webhooks, and x402 micropayments. ~1% protocol fee (0.7% nodeit / 0.3% treasury), settled trustlessly on-chain.
- ⛽ Gasless for payers — they sign an ERC-3009 authorization; the nodeit pays the gas.
- 🧩 Stripe-like DX —
payment_intents.create,webhooks.verify. - 🌐 Open network — no lock-in, self-host or use any nodeit.
Install
pip install openrelay
Requires Python ≥ 3.11. Depends on httpx and pydantic.
Quick start
The client is async (built on httpx.AsyncClient):
import asyncio
from openrelay import OpenRelay
async def main():
# Use a SECRET key, server-side only — never ship it to a client.
async with OpenRelay(api_key="sk_live_...") as relay:
intent = await relay.payment_intents.create(
amount=10_000_000, # 10.00 USDC (6 decimals → 1 USDC = 1_000_000)
currency="usdc",
chain="base",
metadata={"order_id": "123"},
)
print(intent["id"], intent["status"]) # "pi_…", "created"
asyncio.run(main())
Other payment-intent methods: retrieve(id), list(limit=10), cancel(id).
Webhooks
event = relay.webhooks.verify(
payload, # raw request body (str)
signature=request.headers["openrelay-signature"],
secret="whsec_...",
)
if event["type"] == "payment_intent.settled":
fulfill_order(event["data"]["metadata"]["order_id"])
Configuration
OpenRelay(
api_key="sk_live_...", # required — secret key, server-side only
base_url="https://api.openrelay.site", # optional — your OpenRelay API host
timeout=30.0, # optional — seconds
)
Links
- Repo, docs & protocol spec: https://github.com/lacasoft/openrelay
- Source:
packages/sdk-python - License: Apache-2.0
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 openrelay-0.1.0.tar.gz.
File metadata
- Download URL: openrelay-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f434df1720d48b2fdd388e37f5ab762c9d43e312d9e180d1a7031badde0d90d
|
|
| MD5 |
90b268dc1945a2dc11b87a21f94c49e8
|
|
| BLAKE2b-256 |
e73225a4910e50425c4b5cdf5a8dab3885df41d4b34e785fda86325d5f1d7198
|
Provenance
The following attestation bundles were made for openrelay-0.1.0.tar.gz:
Publisher:
release.yml on lacasoft/openrelay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openrelay-0.1.0.tar.gz -
Subject digest:
7f434df1720d48b2fdd388e37f5ab762c9d43e312d9e180d1a7031badde0d90d - Sigstore transparency entry: 1828360663
- Sigstore integration time:
-
Permalink:
lacasoft/openrelay@c1320f4d6a6335493c285e32678ea0dd122278a4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lacasoft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c1320f4d6a6335493c285e32678ea0dd122278a4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openrelay-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openrelay-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c58cd292adbbc8d76a0b1c738cd45f472dc03a2c6875dda7f48884123112f8fe
|
|
| MD5 |
796d8a5fa3f6f09b6b5930874f388c96
|
|
| BLAKE2b-256 |
9e6cc4fb29c9c96cae69402d763bd2d77a98b14eabfc5600f1ca6ea9ec2491b5
|
Provenance
The following attestation bundles were made for openrelay-0.1.0-py3-none-any.whl:
Publisher:
release.yml on lacasoft/openrelay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openrelay-0.1.0-py3-none-any.whl -
Subject digest:
c58cd292adbbc8d76a0b1c738cd45f472dc03a2c6875dda7f48884123112f8fe - Sigstore transparency entry: 1828360725
- Sigstore integration time:
-
Permalink:
lacasoft/openrelay@c1320f4d6a6335493c285e32678ea0dd122278a4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lacasoft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c1320f4d6a6335493c285e32678ea0dd122278a4 -
Trigger Event:
push
-
Statement type: