Cryptographic AI process tracing — chain-anchored receipts for AI agents. Includes solo-dev quickstart CLI.
Project description
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 |
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
orynq_sdk-0.2.0.tar.gz
(53.4 kB
view details)
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
orynq_sdk-0.2.0-py3-none-any.whl
(37.6 kB
view details)
File details
Details for the file orynq_sdk-0.2.0.tar.gz.
File metadata
- Download URL: orynq_sdk-0.2.0.tar.gz
- Upload date:
- Size: 53.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9086f611c4c6737687641150bf71a7244effb89ed74b04bd02151ad7a331ff38
|
|
| MD5 |
40c510416cafb31ca7383d97a581dccf
|
|
| BLAKE2b-256 |
243f7e5386926f98883540707a801b0df9410a7fb6b7490e140c4b1a6fa962b8
|
File details
Details for the file orynq_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: orynq_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edc19d551355ca6df6f9a0ff16c8cfabd3b7bab374bb26c4fc8eb51c6a8a967b
|
|
| MD5 |
b52bf7b709b0e635b336e00ca1d1cb04
|
|
| BLAKE2b-256 |
2d9d8e68626d6047be48c12d98bbe31d3cadccfcf29bae502b704880e6a55877
|