Skip to main content

Python SDK for SKALOR — the Fiduciary Clearing House for AI Agents. Dual-protocol: MPP (Tempo/PathUSD) + x402 (Base L2/USDC).

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.6.0.tar.gz (24.1 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.6.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skalor_sdk-0.6.0.tar.gz
  • Upload date:
  • Size: 24.1 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.6.0.tar.gz
Algorithm Hash digest
SHA256 142de6e98d4c4b428fdd741bfbf9ec3eaae14380be675273d065122411d6ad8d
MD5 5d49dc1eeb5b4ef1bfc9b1ea68965e74
BLAKE2b-256 32558f167eb85e2e896da2376779cfed96bf80026db32e542cef2cf20d9fafb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skalor_sdk-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 25.0 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad8df2ca6622e642d7c806d4c1ed786179ad3b8493ce83d12b8d605fdc0dfa44
MD5 569284dd91d6094a8f4cad1671e0d5d9
BLAKE2b-256 6774b99d3c2473cc8f014ff15744f1e19328ddffe29cbc909037e24911ed1b9c

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