Skip to content
This repository was archived by the owner on Aug 23, 2026. It is now read-only.

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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="ak_your_key_here",
    base_url="https://api.aidecisions.ai",  # default
)

# Check a transaction for compliance risk
result = client.transaction_check(
    amount=9500.00,
    sender="Acme Trading Ltd",
    receiver="Global Logistics SA",
    sender_jurisdiction="panama",
    currency="USD",
)

print(result["risk_level"])       # "high"
print(result["recommendation"])   # "block_and_review"

API Reference

AiDecisionsClient(api_key, base_url, timeout)

Parameter Type Default Description
api_key str required Your API key (ak_...)
base_url str https://api.aidecisions.ai API base URL
timeout int 30 Request timeout (seconds)

client.transaction_check(...)

Check a single transaction for compliance risk.

Parameter Type Required Description
amount float Yes Transaction amount
sender str Yes Sender entity name or ID
receiver str Yes Receiver entity name or ID
sender_jurisdiction str Yes Sender jurisdiction
currency str Yes ISO 4217 currency code
receiver_jurisdiction str No Receiver jurisdiction
graph_centrality float No Pre-computed graph centrality
gnn_score float No Pre-computed GNN risk score

Returns a dict with risk_score, risk_level, risk_factors, recommendation, and components.

client.agent_detection(transactions)

Detect AI-agent behavior from transaction patterns.

Parameter Type Required Description
transactions list[dict] Yes List of transactions with timestamp, amount, sender, receiver

Returns a dict with agent_probability, classification, indicators, and topology.

Error Handling

from ai_decisions import AiDecisionsClient, AuthenticationError, RateLimitError

client = AiDecisionsClient(api_key="ak_your_key_here")

try:
    result = client.transaction_check(
        amount=9500.00,
        sender="Acme Trading Ltd",
        receiver="Global Logistics SA",
        sender_jurisdiction="panama",
        currency="USD",
    )
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")

Exception Hierarchy

  • ApiError -- base exception for all API errors
    • AuthenticationError -- HTTP 401
    • ForbiddenError -- HTTP 403
    • ValidationError -- HTTP 422
    • RateLimitError -- HTTP 429 (includes retry_after attribute)

License

MIT

About

Python SDK for AI DECISIONS Compliance API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages