Metadata-Version: 2.3
Name: fenra
Version: 0.1.0
Summary: Privacy-first AI cost tracking library
Author: Ajdin Ahmetovic
Author-email: Ajdin Ahmetovic <ahmetovicajdin@gmail.com>
Requires-Dist: requests>=2.28.0
Requires-Dist: fenra[openai,anthropic,gemini] ; extra == 'all'
Requires-Dist: anthropic>=0.18.0 ; extra == 'anthropic'
Requires-Dist: pytest>=7.0.0 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0 ; extra == 'dev'
Requires-Dist: mypy>=1.0.0 ; extra == 'dev'
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
Requires-Dist: google-genai>=1.0.0 ; extra == 'gemini'
Requires-Dist: openai>=1.0.0 ; extra == 'openai'
Requires-Python: >=3.11
Provides-Extra: all
Provides-Extra: anthropic
Provides-Extra: dev
Provides-Extra: gemini
Provides-Extra: openai
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://fenra.io/fenra-text.svg" alt="Fenra" width="200">
</p>

# Fenra Python SDK

[![PyPI](https://img.shields.io/pypi/v/fenra.svg)](https://pypi.python.org/pypi/fenra)
[![Python](https://img.shields.io/pypi/pyversions/fenra.svg)](https://pypi.python.org/pypi/fenra)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

FinOps platform for AI cost visibility

## Usage

Install the package:

```bash
pip install fenra
```

Initialize and start tracking:

```python
import fenra
from openai import OpenAI

fenra.init(api_key="your-fenra-api-key")

# Use as normal - costs are tracked automatically
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
```

Works with Anthropic and Gemini the same way.

For custom providers or manual tracking:

```python
fenra.track(
    provider="custom",
    model="my-model",
    input_tokens=100,
    output_tokens=50,
)
```

To disable auto-tracking:

```bash
export FENRA_DISABLE_AUTO_TRACK=1
```

## Support

- [Documentation](https://docs.fenra.io)
- [Contact](mailto:hello@fenra.io)

## Privacy

Fenra is privacy-first by default. No prompts or responses are stored unless explicitly enabled.

## License

The Fenra Python SDK is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License.
