Skip to main content
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 reusable requests.Session. Use it as a context manager when its lifetime is scoped:
For an application-wide singleton, call nozle.close() during shutdown.

Authentication model

  • plans() accepts either a publishable pk_ or secret sk_ key.
  • Every customer, event, checkout, subscription, credit, Entity, usage, entitlement, health, and margin operation requires sk_.
  • Wrong key types fail locally with NozleAuthenticationError before network I/O.
This is a backend SDK. Never expose an sk_, master key, or internal credential to browser or mobile code.

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.
See Errors and retries for handling guidance.

Next steps