Skip to main content

botzone-cost

PyPI version Python versions license

Cost-tracking SDK for Anthropic, OpenAI, and Gemini Python clients. Wrap your existing client; per-call usage flows to your Cost dashboard. Adds zero measurable latency to the host call.

Install

pip install botzone-cost

Usage

from anthropic import Anthropic
from botzone_cost import wrap

client = wrap(Anthropic(), api_key="cost_sk_...", route="follow-up-draft")

Same surface for OpenAI and Gemini:

from openai import OpenAI
import google.generativeai as genai
from botzone_cost import wrap

openai_client = wrap(OpenAI(), route="summariser")
gemini = wrap(genai.GenerativeModel("gemini-2.5-flash"), route="classifier")

Options

arg default
api_key env COST_API_KEY
endpoint env COST_ENDPOINT or https://cost.botzone.ai
route (none: strongly recommended)
user_id (sha256-hashed in the SDK before send)
feature_tag (none)
enabled True
capture_bodies False (reserved, no effect today, see below)

What gets captured

Token counts (including Anthropic prompt-cache reads / writes and OpenAI cached prompt tokens), latency, model, route, user id (hashed), feature tag. Computed USD cost is added server-side from the live pricing table. The Python SDK is metadata-only today: it does not send raw request or response bodies, and the capture_bodies parameter is reserved for future parity with the TypeScript SDK.

End-user identifiers passed via user_id are SHA-256 hashed in the SDK before send; the plaintext never leaves your process.

Metadata

Release files for botzone-cost 0.1.2

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

Source distribution (sdist)

Source distribution for botzone-cost 0.1.2
File Size Uploaded Provenance Actions
botzone_cost-0.1.2.tar.gz 11.2 kB With provenance Details for botzone_cost-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for botzone-cost 0.1.2
File Interpreter ABI Platform Actions
botzone_cost-0.1.2-py3-none-any.whl Python 3 none any Details for botzone_cost-0.1.2-py3-none-any.whl

Total release size: 19.8 kB

Release files / botzone_cost-0.1.2.tar.gz

Download URL botzone_cost-0.1.2.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
158205f4163f9ee9030c586c8293be078fdc1dcb35414becedd99ee8f995b800
BLAKE2b-256 checksum
How to use checksums
a44395084b29bcc331df90705c94b24151439e7198a84cb82985c86a820d2254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release files / botzone_cost-0.1.2-py3-none-any.whl

Download URL botzone_cost-0.1.2-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4482e57489909fb8c6763c40133002734716b732331f9a56a4910bbd5f817c9
BLAKE2b-256 checksum
How to use checksums
02bb93687bd590ac4051ec8a6b187f34c740165a0ab8374bd7f4d915e36c7841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Security for botzone-cost 0.1.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for botzone_cost-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

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.

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