Metadata-Version: 2.4
Name: mintlyr
Version: 0.1.0
Summary: Track AI cost per feature and per user. Zero dependencies.
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# mintlyr (Python)

Track what each AI feature and each user costs. No dependencies; Python 3.9+.

```python
import mintlyr
from openai import OpenAI

mintlyr.init(api_key="ml_live_...")
client = OpenAI()

reply = mintlyr.track_ai(
    feature="summarize",
    provider="openai",
    user_id="user_123",  # hashed before it leaves your server
    call=lambda: client.chat.completions.create(model="gpt-5", messages=[...]),
)
```

Async: `await mintlyr.atrack_ai(feature=..., call=async_fn)`.

- Returns exactly what your call returns; errors from your call propagate unchanged.
- Tracking never raises into or blocks your code. Events are batched and sent in the background.
- In serverless functions or short scripts call `mintlyr.flush()` before exiting.
- `init(..., local_mode=True)` tracks nothing, useful in tests.
- Works with OpenAI, Anthropic and Gemini response objects (or plain dicts).

Not yet published to PyPI; install from the repo for now: `pip install ./packages/sdk-python`.
