Skip to main content

SpendLens

Track your OpenAI costs by user, feature, and endpoint. Two-line integration.

Install

pip install spendlens

Usage

from spendlens import SpendLensClient

client = SpendLensClient(api_key="your-spendlens-api-key")

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
    tags={"user_id": "u_123", "feature": "chat", "endpoint": "/api/chat"},
)

Your costs appear on the dashboard. That's it.

  • Never logs prompts or completions. Only metadata.
  • Never modifies the OpenAI response.
  • Never adds latency. Logging is async.

Metadata

Release files for spendlens 0.1.0

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

Source distribution (sdist)

Source distribution for spendlens 0.1.0
File Size Uploaded Provenance
spendlens-0.1.0.tar.gz 2.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 5.6 kB

Release files / spendlens-0.1.0.tar.gz

Download URL spendlens-0.1.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
78baa937c2b1144515032f19bfe6291dd1b3fd15ea60c5ff69afaf44ea3e876c
BLAKE2b-256 checksum
How to use checksums
74a7266950fec22631e9601bbbaa8bf9c7a9b5176b4a0c2f1f45bad9627f605e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release files / spendlens-0.1.0-py3-none-any.whl

Download URL spendlens-0.1.0-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84c9eaa527da697e5f7619f680937d3648f4ab90c8737de2495fec5f3fd59a41
BLAKE2b-256 checksum
How to use checksums
2c8a2d954a249517e86f568a887dd73fb16a3a13d1f9b5b94ef116ab84daa3d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Security for spendlens 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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