Tare SDK
Drop-in replacement for openai.OpenAI that routes every call through the
Tare proxy and attributes cost to the product feature that made it.
5-line integration
import tare
llm = tare.client(api_key="sk-...", feature="chat")
resp = llm.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Summarise this in one sentence."}],
)
print(resp.choices[0].message.content)
That's it — every call is now tracked in the Tare dashboard, broken down by
the feature label you pass.
Installation
# From the monorepo root (local dev)
pip install -e ./sdk
# Future PyPI release
pip install tare
Configuration
| Env var | Default | Description |
|---|---|---|
TARE_PROXY_URL |
http://localhost:8000 |
Running Tare proxy base URL |
The /v1 path suffix is appended automatically, so you never need to add it.
# Override at call time — useful in staging / prod
llm = tare.client(
api_key="sk-...",
feature="summarizer",
proxy_url="https://tare.internal",
)
How it works
tare.client() returns a standard openai.OpenAI instance configured with:
base_url→<proxy_url>/v1default_headers→{"X-Tare-Feature": "<feature>"}
The proxy forwards the request to OpenAI unchanged, records token usage, cost, and latency against the feature label, then returns the original response. Zero behaviour change for the caller.
Running the test suite
# Requires the proxy running on localhost:8000
cd sdk
pip install -e ".[dev]"
pytest
Reminder: Add a LICENSE file before publishing to PyPI.
Metadata
Release files for tare-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tare_sdk-0.1.0.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tare_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / tare_sdk-0.1.0.tar.gz
| Download URL | tare_sdk-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b403674ff1e306ab3a9b3d03a0df5168430c06fc8c4c7f7c3f2891e1a67f9b93
|
|
BLAKE2b-256 checksum How to use checksums |
5173506988c5f65fe59478b607980ac2ec52d342e9bee4236e75c76f38a0dcfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / tare_sdk-0.1.0-py3-none-any.whl
| Download URL | tare_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d70b2884e929915b77f2ae095265adb6b24e7b46bc6630fb2e7b7ded7d864fa1
|
|
BLAKE2b-256 checksum How to use checksums |
34ba01b2fde0a8a3381075ce95a623f562ea9ca3633d39720ae7a3bf310ce7c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for tare-sdk 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.