Skip to main content

Python SDK for SKALOR — the Fiduciary Clearing House for AI Agents. Three-rail settlement: MPP (Tempo/PathUSD) + x402 (Base L2/USDC) + Canton Network.

Project description

skalor-sdk

Fiduciary Control Plane for AI Agents — Python SDK

SKALOR lets AI developers wrap every paid API call with a fiduciary authorization check. Before your agent spends money at OpenAI, X.com, or any vendor, the control plane validates spending limits, kill switches, and shadow mandates.

Install

pip install skalor-sdk

Or install from source:

cd sdk
pip install -e .

Quick Start

from skalor import Client, SkalorPaymentError

# Initialize with your API key (from dashboard → API Keys)
zc = Client(api_key="sk_live_abc123...")

# Before calling a paid API, authorize the spend
try:
    approval = zc.authorize_spend(
        amount=0.03,          # USD
        merchant="OpenAI",    # Who you're paying
        memo="GPT-4 call",   # Optional audit trail
    )
    print(f"Approved! tx={approval.transaction_id}")
    print(f"Remaining budget: ${approval.remaining_daily_limit}")

    # Now safe to call OpenAI
    # response = openai.chat.completions.create(...)

except SkalorPaymentError as e:
    # Control plane said NO — don't make the call
    print(f"Blocked: {e.reason}")
    # e.reason is one of: AGENT_INACTIVE, EXCEEDS_DAILY_LIMIT, etc.

How It Works

Your Agent                SKALOR                  Vendor API
    │                         │                           │
    ├─ authorize_spend() ────►│                           │
    │                         ├─ Check kill switch        │
    │                         ├─ Check per-tx limit       │
    │                         ├─ Check daily limit        │
    │                         ├─ Settle on Solana         │
    │◄── ApprovalResult ──────┤                           │
    │                         │                           │
    ├─ (if approved) call ───────────────────────────────►│
    │◄── response ────────────────────────────────────────┤

Exceptions

Exception Status When
SkalorPaymentError 402/403 Spend denied (over limit, inactive agent)
SkalorAuthError 401 Invalid API key
SkalorRateLimitError 429 Too many requests
SkalorNetworkError API unreachable

Denial Reasons

When SkalorPaymentError is raised, check e.reason:

  • AGENT_INACTIVE — Kill switch is off
  • AGENT_PAUSED / AGENT_SUSPENDED / AGENT_REVOKED
  • EXCEEDS_PER_TX_LIMIT — Single transaction too large
  • EXCEEDS_DAILY_LIMIT — Daily budget exhausted
  • INSUFFICIENT_TREASURY — Not enough funds in treasury
  • MERCHANT_NOT_AUTHORIZED — Vendor not on allowlist

Configuration

# Custom endpoint (self-hosted or dev)
zc = Client(
    api_key="sk_live_abc123...",
    base_url="http://localhost:8081",
    timeout=10.0,
)

# Context manager
with Client(api_key="sk_live_abc123...") as zc:
    result = zc.authorize_spend(amount=1.00, merchant="Helius")

License

MIT

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

skalor_sdk-0.7.0.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

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

skalor_sdk-0.7.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file skalor_sdk-0.7.0.tar.gz.

File metadata

  • Download URL: skalor_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for skalor_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 479bb84d5d5fe739f6f5d402d861fa3dab504d258354ace0de616e3774810502
MD5 0d0a07411b58883582fa6fde82f63495
BLAKE2b-256 bb9f8f8a06fcda6b82431666dcdc476f10e8889a751be40e0f0e87988097db3a

See more details on using hashes here.

File details

Details for the file skalor_sdk-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: skalor_sdk-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for skalor_sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eed54df9382ee8db8e6fe504ae3321cdbd41147a7b8da9ac7de4d1d7183453cb
MD5 8033553fc245f2fa7f89bc093e5f6c56
BLAKE2b-256 a0edbb6844d96db45f0456a18aa2f383b02b534158596da8f7050365980fddb8

See more details on using hashes here.

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