kindl-sdk is the official Python SDK for Kindl, the
protocol-neutral payment rail for autonomous software (MCP, A2A, OpenAPI,
GPT Actions, Claude Skills, raw HTTP) over both Stripe and x402 (USDC on Base).
pip install kindl-sdkThe install name is kindl-sdk (the bare name kindl is reserved on PyPI).
The import name is still kindl:
from kindl import meterfrom kindl import meter
@meter(tool="search_legal_db", server_key="ksk_live_xxx", price_cents=2)
def search_legal_db(query: str, *, consumer_key: str | None = None):
return run_search(query)That's it. Kindl handles:
- API-key auth (
ksk_…server key,kck_…consumer key) - Per-call billing (price set in your Kindl console)
- HTTP 402 Payment Required on zero-balance consumers
- Logging every call to your dashboard
- Stripe Connect payouts (95% to creator, 5% platform fee)
from kindl import call, PaymentRequired
try:
result = call(
server_key="ksk_live_xxx",
consumer_key="kck_live_xxx",
tool="search_legal_db",
args={"query": "GDPR for solo founders"},
)
print(result.cost_cents, result.remaining_balance_cents)
except PaymentRequired as e:
# top up via Stripe and retry
print("HTTP 402:", e, "remaining:", e.remaining_balance_cents)In order:
- The
consumer_key=keyword argument on each call. - The
KINDL_CONSUMER_KEYenvironment variable. - The
x-kindl-consumer-keyHTTP header (passhttp_headers=req.headersfrom inside FastAPI / MCP runtimes).
from kindl import configure
configure("https://YOUR-KINDL-INSTANCE") # or set KINDL_BASE_URL envApache-2.0 licensed. Source: https://github.com/smq9sn5jck-coder/kindl-sdk