Metadata-Version: 2.4
Name: costimizer
Version: 0.1.0
Summary: Costimizer AI observability SDK for LLM FinOps
Author-email: Costimizer <itadmin@costimizer.ai>
License: MIT
Project-URL: Homepage, https://costimizer.ai
Project-URL: Documentation, https://costimizer.ai
Project-URL: Repository, https://gitlab.bigohtech.com/costimizer/finops/finops-ai-sdk
Project-URL: Issues, https://gitlab.bigohtech.com/costimizer/finops/finops-ai-sdk/-/issues
Keywords: llm,finops,observability,openai,anthropic,gemini,openrouter,cost-tracking
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.28.0
Provides-Extra: openai
Requires-Dist: openai>=1.60.0; extra == "openai"
Provides-Extra: openrouter
Requires-Dist: openai>=1.60.0; extra == "openrouter"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40.0; extra == "anthropic"
Provides-Extra: gemini
Requires-Dist: google-genai>=1.0.0; extra == "gemini"
Provides-Extra: google
Requires-Dist: google-genai>=1.0.0; extra == "google"
Provides-Extra: all
Requires-Dist: openai>=1.60.0; extra == "all"
Requires-Dist: anthropic>=0.40.0; extra == "all"
Requires-Dist: google-genai>=1.0.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.3.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.1.0; extra == "dev"
Dynamic: license-file

# Costimizer Python SDK

[![PyPI](https://img.shields.io/pypi/v/costimizer.svg)](https://pypi.org/project/costimizer/)

Capture LLM calls and send them to Costimizer FinOps.

Install only the provider client you use — same pattern as PostHog:

```bash
pip install "costimizer[openai]"
pip install "costimizer[all]"   # every provider
```

Core SDK (`httpx` only) installs with:

```bash
pip install costimizer
```

## OpenAI

```bash
pip install "costimizer[openai]"
```

```python
from costimizer import Costimizer
from costimizer.ai.openai import OpenAI

costimizer = Costimizer(
    project_token="fo_ingest_your_key",
    host="https://api.costimizer.ai",
)

client = OpenAI(
    api_key="sk-...",
    costimizer_client=costimizer,
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}],
    costimizer_trace_name="support-chat",
)
costimizer.shutdown()
```
