Skip to main content

Nozle SDK — usage tracking, margin intelligence, and entitlement checks for AI billing

Project description

Nozle

Python SDK for usage tracking, margin intelligence, and entitlement checks.

Install

pip install nozle-sdk

Quick Start

from nozle import Nozle

client = Nozle(
    api_key="your-api-key",
    base_url="https://api.your-domain.com",
    events_url="https://events.your-domain.com",
)

# Track usage events
client.track("customer_123", "api_call", metadata={"model": "gpt-4", "tokens": 1500})

# Check feature entitlements
result = client.can("customer_123", "advanced_analytics")

# Margin intelligence
summary = client.margin.summary()
by_customer = client.margin.by_customer()
by_model = client.margin.by_model()
trend = client.margin.trend(granularity="day")

Margin Intelligence

The margin client exposes several views into your cost and revenue data:

client.margin.summary()                        # overall margin summary
client.margin.by_customer()                    # margin broken down by customer
client.margin.by_metric()                      # margin broken down by billable metric
client.margin.by_plan()                        # margin broken down by plan
client.margin.by_model()                       # margin broken down by AI model
client.margin.trend(granularity="day")         # margin trend over time

Optional: OpenAI Integration

pip install nozle-sdk-sdk[openai]

License

AGPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nozle_sdk-0.1.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nozle_sdk-0.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file nozle_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: nozle_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nozle_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 be55a50a41d8deee80fd4423b5a452cf849d4de8f6995236ae0f9e35a9955fab
MD5 aa1fa55e2fd88ce1013dd7242d271fda
BLAKE2b-256 74ff5ce48cfe4b249ff3eff1e5faebd59205efe1e6839378aa50d62e264305fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for nozle_sdk-0.1.0.tar.gz:

Publisher: publish.yml on nozle-app/nozle-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nozle_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nozle_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nozle_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 901cd0b553ab8d8c2220774ef9231a18445b3a4d0fb17ed60dd6f571151be679
MD5 b7369b2bb0a2b45314768a058564d9a8
BLAKE2b-256 3ed6af329a7eaf89abb3b1ecab2bbef027dffb6bd982542263b13e5f5d44e093

See more details on using hashes here.

Provenance

The following attestation bundles were made for nozle_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on nozle-app/nozle-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page