V7 AI FinOps SDK — transparent cost telemetry for Anthropic and OpenAI Python clients
Project description
aivyuh-finops
Transparent cost telemetry for Anthropic and OpenAI Python clients. Part of the V7 AI FinOps platform.
Wrap your existing AI SDK client in one line — aivyuh-finops captures model, tokens, cost, and latency metadata and sends it to the V7 backend. It never reads or stores prompt or response content.
Install
pip install aivyuh-finops
With provider extras:
pip install aivyuh-finops[anthropic] # includes anthropic SDK
pip install aivyuh-finops[openai] # includes openai SDK
pip install aivyuh-finops[all] # both
Quickstart
Anthropic
from anthropic import Anthropic
from aivyuh_finops import wrap_anthropic
client = wrap_anthropic(Anthropic(), {
"telemetry_endpoint": "https://finops-api.aivyuh.com/telemetry",
"customer_id": "cust-123",
"project": "my-app",
"tags": {"feature": "chat", "team": "product"},
})
# Use the client exactly as before — all types are preserved
message = client.messages.create(
model="claude-sonnet-4-6-20260320",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude!"}],
)
OpenAI
from openai import OpenAI
from aivyuh_finops import wrap_openai
client = wrap_openai(OpenAI(), {
"telemetry_endpoint": "https://finops-api.aivyuh.com/telemetry",
"customer_id": "cust-123",
"project": "my-app",
"tags": {"feature": "search", "team": "platform"},
})
# Use the client exactly as before
completion = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello, GPT!"}],
)
Configuration
| Option | Type | Required | Description |
|---|---|---|---|
telemetry_endpoint |
str |
Yes | V7 telemetry ingest URL (https://finops-api.aivyuh.com/telemetry) |
customer_id |
str |
Yes | Your customer ID for cost attribution |
project |
str |
No | Project name for grouping costs |
tags |
dict[str, str] |
No | Custom key-value tags attached to every request |
disable_telemetry |
bool |
No | Set True to disable (useful in tests) |
Production API Endpoint
https://finops-api.aivyuh.com/telemetry
POST telemetry payloads are accepted with a 202 Accepted response. The endpoint is fire-and-forget — if unreachable, your application is unaffected.
How It Works
wrap_anthropic()/wrap_openai()monkey-patchesmessages.create()orchat.completions.create().- After each successful call, it extracts usage metadata (model, tokens, latency) and estimates cost.
- A background thread sends the telemetry payload via HTTP POST — errors are silently swallowed.
- Your original response is returned untouched. Zero external dependencies (uses
urllib+threading).
Requirements
- Python >= 3.10
anthropic>= 0.40.0 and/oropenai>= 1.50.0 (optional peer dependencies)
License
MIT
Project details
Release history Release notifications | RSS feed
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 aivyuh_finops-0.1.0.tar.gz.
File metadata
- Download URL: aivyuh_finops-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a4fa22b8ed2248381270f119b4f56c53ff626bc39e45655f607cd238eafd3fc
|
|
| MD5 |
530f37884db246e094fe478ac0924322
|
|
| BLAKE2b-256 |
8ca41b7c45339eaeeb46d2c310fd3b57ddd6f9c8a7a0070283d65d2c9f3c9249
|
File details
Details for the file aivyuh_finops-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aivyuh_finops-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22d1aa1d806912f73bf1f0def9558cf4279f8e1624d6ad8ddd1d5e54ae38e0a2
|
|
| MD5 |
040c5038e237420bbe18d6187003d37f
|
|
| BLAKE2b-256 |
f19b5b323205b63a2b00e1bf580b6a8ef9c0046944d3ba620dcd4a101a159e18
|