Skip to main content

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 DXpayment_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

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

openrelay-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

openrelay-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for openrelay-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f434df1720d48b2fdd388e37f5ab762c9d43e312d9e180d1a7031badde0d90d
MD5 90b268dc1945a2dc11b87a21f94c49e8
BLAKE2b-256 e73225a4910e50425c4b5cdf5a8dab3885df41d4b34e785fda86325d5f1d7198

See more details on using hashes here.

Provenance

The following attestation bundles were made for openrelay-0.1.0.tar.gz:

Publisher: release.yml on lacasoft/openrelay

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

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

Hashes for openrelay-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c58cd292adbbc8d76a0b1c738cd45f472dc03a2c6875dda7f48884123112f8fe
MD5 796d8a5fa3f6f09b6b5930874f388c96
BLAKE2b-256 9e6cc4fb29c9c96cae69402d763bd2d77a98b14eabfc5600f1ca6ea9ec2491b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for openrelay-0.1.0-py3-none-any.whl:

Publisher: release.yml on lacasoft/openrelay

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