Python SDK for NullSpend — FinOps for AI agents
Project description
nullspend
Python SDK for NullSpend — FinOps for AI agents.
Installation
pip install nullspend
Quick Start
from nullspend import NullSpend, CostEventInput
ns = NullSpend(
base_url="https://nullspend.dev",
api_key="ns_live_sk_...",
)
# Report a cost event
ns.report_cost(CostEventInput(
provider="openai",
model="gpt-4o",
input_tokens=1200,
output_tokens=350,
cost_microdollars=5250,
tags={"environment": "production", "agent": "support-bot"},
))
# Check budget status
status = ns.check_budget()
for entity in status.entities:
print(f"{entity.entity_type}/{entity.entity_id}: "
f"${entity.remaining_microdollars / 1_000_000:.2f} remaining")
Features
- Cost event reporting (single and batch)
- Budget status and listing
- Cost analytics summaries
- Human-in-the-loop action management (create, poll, mark result)
propose_and_wait()high-level orchestrator- Automatic retries with exponential backoff
- Idempotency keys on mutating requests
- Type hints throughout (py.typed)
Documentation
See the NullSpend docs for full API reference.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nullspend-0.2.0.tar.gz.
File metadata
- Download URL: nullspend-0.2.0.tar.gz
- Upload date:
- Size: 56.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
325a18a00270521c7477dd3e9a9462d4446bfd09e40d0d87b7cdf5e1b7b6c7d9
|
|
| MD5 |
1e4823f29f6ed8d23bfe3d72c6d25b76
|
|
| BLAKE2b-256 |
bc1b22bdea018923307d8a53dc28d81791fa5b1393a4e7405693403af6d49106
|
Provenance
The following attestation bundles were made for nullspend-0.2.0.tar.gz:
Publisher:
publish-python.yml on NullSpend/nullspend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nullspend-0.2.0.tar.gz -
Subject digest:
325a18a00270521c7477dd3e9a9462d4446bfd09e40d0d87b7cdf5e1b7b6c7d9 - Sigstore transparency entry: 1302801892
- Sigstore integration time:
-
Permalink:
NullSpend/nullspend@a1770e439359beb083b0d42e8e520d7b6267470c -
Branch / Tag:
refs/tags/python-sdk-v0.2.0 - Owner: https://github.com/NullSpend
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a1770e439359beb083b0d42e8e520d7b6267470c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nullspend-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nullspend-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86f46cd3957f7f3b34ec3e527cd970b1838862ce84b5721b32bd18c9bc95953
|
|
| MD5 |
36a56533a3ac05f5ad295a2668f704f5
|
|
| BLAKE2b-256 |
26d2b9a6dd21d86b9e5151ff28d2a52acbb68e7bea645025945cb840f835065c
|
Provenance
The following attestation bundles were made for nullspend-0.2.0-py3-none-any.whl:
Publisher:
publish-python.yml on NullSpend/nullspend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nullspend-0.2.0-py3-none-any.whl -
Subject digest:
e86f46cd3957f7f3b34ec3e527cd970b1838862ce84b5721b32bd18c9bc95953 - Sigstore transparency entry: 1302802096
- Sigstore integration time:
-
Permalink:
NullSpend/nullspend@a1770e439359beb083b0d42e8e520d7b6267470c -
Branch / Tag:
refs/tags/python-sdk-v0.2.0 - Owner: https://github.com/NullSpend
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a1770e439359beb083b0d42e8e520d7b6267470c -
Trigger Event:
push
-
Statement type: