Skip to main content

AI DECISIONS Python SDK

Official Python client for the AI DECISIONS Compliance API.

Installation

pip install ai-decisions

Quick Start

from ai_decisions import AiDecisionsClient

client = AiDecisionsClient(api_key="your-api-key")

# Address screening — the billed unit
# (RESEARCH 25/mo free, ANALYST 500/mo, ENTERPRISE 10,000/mo)
verdict = client.screen("ethereum", "0x8589427373D6D84E98730D7795D8f6f8731FDA16")

print(verdict["risk_score"])      # 0.0 - 1.0 (None on unserved chains)
print(verdict["risk_tier"])       # 1 - 5
print(verdict["category"])        # e.g. "mixer", "exchange", "personal"
print(verdict["sanctions_hit"])   # True on OFAC SDN addresses
print(verdict["mixer_exposure"])  # {"direct": ..., "mixer_names": [...], ...}

# Chains: ethereum, tron, bitcoin, arbitrum, base, gnosis

# Similar wallets (ENTERPRISE) — guilt-by-association over GNN embeddings
similar = client.similar("ethereum", "0x8589427373D6D84E98730D7795D8f6f8731FDA16", top_k=5)
print(similar["neighbours"])      # [{"address", "chain", "similarity", "label", "category"}]

# Transaction risk scoring
result = client.transaction_check(
    amount=150_000,
    sender="Acme Corp",
    receiver="Shell Ltd",
    sender_jurisdiction="US",
    receiver_jurisdiction="CY",
    currency="USD",
)

print(result["risk_score"])       # 0.0 - 1.0
print(result["risk_level"])       # "low" | "medium" | "high" | "critical"
print(result["risk_factors"])     # [{"rule": ..., "detail": ..., "severity": ...}]
print(result["recommendation"])   # "APPROVE" | "REVIEW" | "ESCALATE" | "BLOCK"

# AI-agent detection
detection = client.agent_detection([
    {"timestamp": "2026-01-15T10:00:00", "amount": 500, "sender": "w1", "receiver": "w2"},
    {"timestamp": "2026-01-15T10:01:00", "amount": 500, "sender": "w1", "receiver": "w3"},
    {"timestamp": "2026-01-15T10:02:00", "amount": 500, "sender": "w1", "receiver": "w4"},
])

print(detection["agent_probability"])  # 0.0 - 1.0
print(detection["classification"])     # "likely_human" | "likely_agent"
print(detection["indicators"])         # [{"indicator": ..., "detail": ..., "score": ...}]

Error Handling

The SDK raises typed exceptions for common HTTP errors:

from ai_decisions import (
    AiDecisionsClient,
    AiDecisionsError,
    AuthenticationError,
    RateLimitError,
    ValidationError,
)

client = AiDecisionsClient(base_url="https://api.example.com", api_key="key")

try:
    result = client.transaction_check(amount=100, sender="A", receiver="B")
except AuthenticationError:
    # 401 - invalid or missing API key
    print("Check your API key")
except RateLimitError as exc:
    # 429 - rate limit exceeded (after automatic retries)
    print(f"Rate limited. Retry after {exc.retry_after}s")
except ValidationError:
    # 422 - invalid request payload
    print("Check request parameters")
except AiDecisionsError as exc:
    # Any other API error
    print(f"API error (HTTP {exc.status_code}): {exc}")

Configuration

Parameter Type Default Description
base_url str - API base URL
api_key str "" API key (sent as X-API-Key)
timeout int 30 Request timeout in seconds
max_retries int 3 Max retries on 429 Too Many Requests

Retry Behavior

The SDK automatically retries requests that receive a 429 Too Many Requests response. It respects the Retry-After header if present, otherwise uses exponential backoff (2^attempt seconds). After max_retries attempts, a RateLimitError is raised.

Metadata

Release files for ai-decisions 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 ai-decisions 0.2.0
File Size Uploaded Provenance
ai_decisions-0.2.0.tar.gz 7.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-decisions 0.2.0
File Interpreter ABI Platform
ai_decisions-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / ai_decisions-0.2.0.tar.gz

Download URL ai_decisions-0.2.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
394ed44e162e31f5bf60f7813889b704de19839bdab2b54e27acc865f5ab260d
BLAKE2b-256 checksum
How to use checksums
533aa174c9fce1bf7c908a18be6d98c6ad20c0f769051b0f15e8999c978199b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL ai_decisions-0.2.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b28e8939d8e029bb57ecaf038465a1c67aca3297ab08abd8937e3a4738c4832
BLAKE2b-256 checksum
How to use checksums
aba870d4f771d4e6ed80238b5c2a3c4a3e7ccd120e8068990592488192f4377e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ai-decisions 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