Skip to main content

orynq-sdk Python

Note: The Python SDK currently supports Flux protocol only (Cardano). x402 protocol support for EVM chains is planned for a future release.

Dual-protocol commerce layer for Cardano/EVM payments.

Installation

pip install orynq-sdk

Optional Dependencies

# For Cardano support (pycardano)
pip install orynq-sdk[cardano]

# For AWS KMS signing
pip install orynq-sdk[aws]

# For development
pip install orynq-sdk[dev]

Quick Start

import asyncio
from orynq_sdk import PoiClient, BudgetConfig

async def main():
    # Create a client with auto-pay enabled
    client = PoiClient(
        base_url="https://api.example.com",
        payer=my_payer,  # Your Payer implementation
        partner="my_partner_id",
        budget=BudgetConfig(
            max_per_request="1000000",  # 1 ADA max per request
            max_per_day="10000000",      # 10 ADA max per day
        )
    )

    async with client:
        # Requests automatically handle 402 Payment Required
        result = await client.request(
            "/v1/inference",
            body={"prompt": "Hello, world!"}
        )
        print(result)

asyncio.run(main())

Implementing a Payer

from orynq_sdk import BasePayer, PaymentRequest, PaymentProof

class MyCardanoPayer(BasePayer):
    supported_chains = ["cardano:mainnet", "cardano:preprod"]

    async def get_address(self, chain: str) -> str:
        # Return your wallet address
        return "addr1..."

    async def pay(self, request: PaymentRequest) -> PaymentProof:
        # Build and submit transaction
        tx_hash = await self._submit_payment(request)
        return PaymentProof(
            kind="cardano-txhash",
            tx_hash=tx_hash
        )

    async def get_balance(self, chain: str, asset: str) -> int:
        # Query wallet balance
        return 5000000  # 5 ADA in lovelace

Features

  • Auto-pay: Automatically handles 402 Payment Required responses
  • Budget tracking: Per-request and daily spending limits
  • Invoice caching: Prevents double-payment
  • Streaming: NDJSON streaming support for long-running requests
  • Signers: Memory (dev) and KMS (prod) signer implementations

Version & Protocol Support

v0.1.0

Protocol Status
Flux (Cardano) Supported
x402 (EVM) Not yet supported

Metadata

Release files for orynq-sdk 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 orynq-sdk 0.2.0
File Size Uploaded Provenance Actions
orynq_sdk-0.2.0.tar.gz 53.4 kB Without provenance Details for orynq_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orynq-sdk 0.2.0
File Interpreter ABI Platform Actions
orynq_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for orynq_sdk-0.2.0-py3-none-any.whl

Total release size: 90.9 kB

Release files / orynq_sdk-0.2.0.tar.gz

Download URL orynq_sdk-0.2.0.tar.gz
Size 53.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9086f611c4c6737687641150bf71a7244effb89ed74b04bd02151ad7a331ff38
BLAKE2b-256 checksum
How to use checksums
243f7e5386926f98883540707a801b0df9410a7fb6b7490e140c4b1a6fa962b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

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

Download URL orynq_sdk-0.2.0-py3-none-any.whl
Size 37.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edc19d551355ca6df6f9a0ff16c8cfabd3b7bab374bb26c4fc8eb51c6a8a967b
BLAKE2b-256 checksum
How to use checksums
2d9d8e68626d6047be48c12d98bbe31d3cadccfcf29bae502b704880e6a55877
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for orynq-sdk 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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