Skip to main content

limitguard

Official Python SDK for the LimitGuard Trust Intelligence API: entity verification and risk scoring for EU businesses, paid per call in USDC over x402 or covered by a subscription.

Install

pip install limitguard

With wallet support, for agents that pay per call:

pip install 'limitguard[solana]'   # Solana USDC
pip install 'limitguard[evm]'      # Base USDC

Python 3.10 or newer.

Quickstart

import asyncio
from limitguard import LimitGuardClient


async def main():
    async with LimitGuardClient(api_key="lg_live_...") as client:
        result = await client.check_entity("Acme BV", country="NL")
        print(result.trust_score, result.trust_level, result.recommendation)


asyncio.run(main())

check_entity returns a TrustResponse (trust_score 0-100, trust_level, cluster, recommendation, confidence, top_factors). risk_score is the cheaper two-source variant and returns a RiskResponse.

Paying for calls

Two ways to satisfy the API's per-call price, and the client accepts either or both:

You pass What happens
api_key= on a paid tier (indie and up) The subscription covers usage. No per-call payment.
wallet= The client pays each call in USDC over x402 automatically when the API answers 402, echoes the X-Payment-Challenge the 402 carried on the paid retry (the proof is only redeemable together with it), and signs that challenge with the paying wallet.
both Calls are paid by the wallet and attributed to the key.

A free-tier key identifies you and tracks usage; it does not pay for calls. On its own it will raise PaymentRequiredError on any paid endpoint. Add a wallet, or upgrade the key.

Wallet example (Solana, needs the [solana] extra and a wallet holding USDC — no SOL: LimitGuard's fee payer co-signs the transaction and covers the network fee. Pass broadcast=True to SolanaWallet to pay it yourself instead, which requires SOL):

from solders.keypair import Keypair
from limitguard import LimitGuardClient
from limitguard.x402 import SolanaWallet

wallet = SolanaWallet(keypair=Keypair.from_base58_string(private_key))
async with LimitGuardClient(wallet=wallet) as client:
    result = await client.check_entity("Acme BV", country="NL")

SolanaWallet pays in Solana USDC and EvmWallet in Base USDC; both take the key of the wallet the money leaves.

When the API quotes a settled-transfer price, the client also signs a short challenge message with the same wallet that sent the USDC and puts it in X-Payment-Challenge-Signature. The message is the protocol tag, the resource path, the chain id, your transaction hash or signature, and the challenge id — five lines, exactly as documented on the x402 protocol page. It exists because a transaction hash is public the moment it lands: without the signature, anyone who saw it could redeem your payment. Your private key never leaves the wallet object, and a wallet that cannot sign still pays — the field is optional server-side today and will become required, so signing now means nothing breaks later.

A complete agent is in examples/agent_with_wallet.py, included in the source distribution (pip download --no-binary :all: limitguard).

Errors

All exceptions subclass LimitGuardError: AuthenticationError, PaymentRequiredError, RateLimitError, ValidationError, ServerError. The client retries 429 and 5xx responses with backoff before raising.

Version

import limitguard
print(limitguard.__version__)

Releases are tagged sdk-v<version> and published to PyPI from that tag.

Release files for limitguard 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for limitguard 0.1.2
File Size Uploaded
limitguard-0.1.2.tar.gz 17.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for limitguard 0.1.2
File Interpreter ABI Platform
limitguard-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 35.7 kB

Release files / limitguard-0.1.2.tar.gz

Download URL limitguard-0.1.2.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
257c8f9b3a405331f6b98318b4be90f431bb70e8bcd832d8d52a69d4349c7909
BLAKE2b-256 checksum
How to use checksums
d7f34552fdaef7a8d39fb46831248d8c71404780a2648fbfa44167845ac977a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / limitguard-0.1.2-py3-none-any.whl

Download URL limitguard-0.1.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fb70bad913042ac6278e968a20376a2a29462b0bf304705717d836723dfb8b0
BLAKE2b-256 checksum
How to use checksums
0266ec69683fc8e76a6706a39d1d9c27313d0be5b55a059a2914fa67f7723f35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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