nozle-sdk supports Python 3.9 through 3.13, uses requests, and includes a py.typed marker.
Entity subscription APIs are introduced in 0.5.0.
Create a client
Set both URLs explicitly outside local development. Trailing slashes are removed automatically.
Manage the HTTP session
The client is synchronous and owns a reusablerequests.Session. Use it as a context manager when its lifetime is scoped:
nozle.close() during shutdown.
Authentication model
plans()accepts either a publishablepk_or secretsk_key.- Every customer, event, checkout, subscription, credit, Entity, usage, entitlement, health, and margin operation requires
sk_. - Wrong key types fail locally with
NozleAuthenticationErrorbefore network I/O.
API surface
check_and_deduct() remains available for the legacy wallet path.
Transport behavior
- The SDK does not automatically retry requests.
- Mutations therefore execute at most once per SDK call.
- Connection and timeout failures raise
NozleTransportError. - Non-2xx responses raise structured
NozleAPIError. - Sensitive values in API error payloads are redacted.