Metadata-Version: 2.4
Name: llm-cost-monitor
Version: 1.0.0
Summary: Official Python SDK for LLM Cost Monitor - Track, aggregate, and analyze LLM usage costs
Home-page: 
Author: OpenAPI Generator community
Author-email: LLM Cost Monitor <support@llmcost.dev>
License: MIT
Project-URL: Homepage, https://github.com/check-ai/llm-cost-monitor
Project-URL: Repository, https://github.com/check-ai/llm-cost-monitor
Project-URL: Documentation, https://github.com/check-ai/llm-cost-monitor#readme
Project-URL: Issues, https://github.com/check-ai/llm-cost-monitor/issues
Keywords: llm,cost,monitoring,openai,anthropic,gpt,claude,ai,sdk,observability
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author

# llmcost
Open-source LLM cost observability platform API.
Track, aggregate, and analyze LLM usage costs across your applications.


This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: v1.0.0
- Package version: 1.0.0
- Generator version: 7.18.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 3.9+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import llmcost
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import llmcost
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import llmcost
from llmcost.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8080
# See configuration.py for a list of all supported configuration parameters.
configuration = llmcost.Configuration(
    host = "http://localhost:8080"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'


# Enter a context with an instance of the API client
with llmcost.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = llmcost.AlertsApi(api_client)
    create_alert_request = {"threshold":100.0,"window_interval":"24h"} # CreateAlertRequest | 

    try:
        # Create budget alert
        api_response = api_instance.create_alert(create_alert_request)
        print("The response of AlertsApi->create_alert:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AlertsApi->create_alert: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *http://localhost:8080*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AlertsApi* | [**create_alert**](docs/AlertsApi.md#create_alert) | **POST** /v1/alerts | Create budget alert
*AlertsApi* | [**delete_alert**](docs/AlertsApi.md#delete_alert) | **DELETE** /v1/alerts/{id} | Delete alert
*AlertsApi* | [**list_alerts**](docs/AlertsApi.md#list_alerts) | **GET** /v1/alerts | List budget alerts
*EventsApi* | [**create_event**](docs/EventsApi.md#create_event) | **POST** /v1/events | Track LLM usage event
*EventsApi* | [**list_events**](docs/EventsApi.md#list_events) | **GET** /v1/events | List LLM usage events
*MetricsApi* | [**get_metrics**](docs/MetricsApi.md#get_metrics) | **GET** /v1/metrics | Get aggregated metrics
*PricingApi* | [**list_pricing**](docs/PricingApi.md#list_pricing) | **GET** /v1/pricing | List model pricing


## Documentation For Models

 - [Alert](docs/Alert.md)
 - [CreateAlertRequest](docs/CreateAlertRequest.md)
 - [CreateEventRequest](docs/CreateEventRequest.md)
 - [ErrorResponse](docs/ErrorResponse.md)
 - [ErrorResponseError](docs/ErrorResponseError.md)
 - [Event](docs/Event.md)
 - [EventListResponse](docs/EventListResponse.md)
 - [EventResponse](docs/EventResponse.md)
 - [MetricPoint](docs/MetricPoint.md)
 - [MetricsResponse](docs/MetricsResponse.md)
 - [ModelPricing](docs/ModelPricing.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="ApiKeyAuth"></a>
### ApiKeyAuth

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header


## Author




