Installation
Quick start
API reference
Constructor
user_agent to prepend your app’s identifier so AgentScore support can trace outbound traffic back to you:
client.get_reputation(address, chain=None)
Look up a wallet’s cached reputation profile. Free tier. Returns score, verification_level ("none", "wallet_claimed", or "kyc_verified"), chains array, and optionally operator_score, reputation, and agents.
client.assess(address=None, chain=None, refresh=False, policy=None, operator_token=None, signer=None)
On-the-fly trust assessment with policy evaluation. Paid tier only. Provide address (wallet) or operator_token (credential).
Server-side signer-match + OFAC SDN screening
Passsigner={"address", "network"} to opt into server-side wallet-signer-match and OFAC SDN wallet-address screening in a single round trip:
signer.address=None for rails with no wallet signer (Stripe SPT, card) — the response’s signer_match.kind will be wallet_auth_requires_wallet_signing. Wallet-OFAC SDN enforcement on the signer block is unconditional whenever a signer is supplied — no policy.require_sanctions_clear opt-in required. A signer_sanctions hit OR status: "unavailable" flips decision to deny with decision_reasons including sanctions_flagged or sanctions_check_unavailable respectively (fail-closed; OFAC strict-liability). policy.require_sanctions_clear is the separate NAME-based screen on the resolved operator’s KYC identity.
The aassess() async variant takes the same signer keyword.
Compliance assessment
Use compliance policy fields to enforce KYC, sanctions, age, and jurisdiction requirements:Quota observability
assess() / aassess() responses include an optional quota field captured from X-Quota-Limit / X-Quota-Used / X-Quota-Reset headers so callers can monitor approach-to-cap proactively before hitting 429:
reset is an ISO-8601 timestamp or the literal string "never" for unlimited tiers; numeric fields are None when the API didn’t include the header.
Typed errors
The SDK raises subclasses ofAgentScoreError so callers can branch on the class without parsing err.code:
wallet_signer_mismatch responses (verdict, not exception), the SDK consumer can spread signer_match.agent_instructions (a JSON-encoded {action, steps, user_message} envelope) directly into a 403 body without re-deriving recovery copy.
client.create_session(context=None, product_name=None, address=None, operator_token=None)
Create a verification session for identity bootstrapping. Returns session details for agent polling.
address and operator_token are optional pre-association hints; pass a wallet address to attach the session to a known wallet, or an existing opc_... to refresh KYC for an existing credential.
client.poll_session(session_id, poll_secret)
Poll a verification session. Returns operator_token when the operator completes verification.
client.create_credential(label=None, ttl_days=None)
Create an operator credential. Default TTL is 24 hours, configurable 1-365 days.
client.list_credentials()
List active (non-expired, non-revoked) credentials.
client.revoke_credential(credential_id)
Revoke a credential by ID.
client.associate_wallet(operator_token, wallet_address, network, idempotency_key=None)
Report a signer wallet that paid under a credential. Used by merchants after successful payment to build a cross-merchant credential↔wallet profile.
{"associated": True, "first_seen": bool, "deduped"?: True}.
Async support
All methods have async counterparts prefixed witha:
async with) automatically closes the HTTP client on exit.
Sync context manager
Error handling
.status property mirrors .status_code so polyglot codebases can use the same attribute name regardless of which SDK raised the error.
AgentScoreError.details: dict[str, Any] carries response-body fields beyond {code, message}; verify_url, linked_wallets, claimed_operator, actual_signer, expected_signer, reasons, agent_memory; so callers can branch on granular denial codes without re-parsing: