Official Python client for the AI DECISIONS Compliance API.
pip install ai-decisionsfrom 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"| 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) |
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.
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.
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")ApiError-- base exception for all API errorsAuthenticationError-- HTTP 401ForbiddenError-- HTTP 403ValidationError-- HTTP 422RateLimitError-- HTTP 429 (includesretry_afterattribute)
MIT