Skip to content

๐Ÿš€ openai_pricing_logger: Track & log OpenAI API costs with ease. A Python package for monitoring GPT-3.5-turbo & GPT-4 usage costs. Lightweight, automatic cost logging. Ideal for developers, data scientists. OpenAI cost tracking, API logging, Python, GPT models

License

Notifications You must be signed in to change notification settings

yachty66/openai_pricing_logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

openai_pricing_logger

openai_pricing_logger is a Python package that logs OpenAI API costs and timestamps. It's designed to help you keep track of API usage and related costs, providing an easy way to monitor and analyze the expenses.

Features

  • Automatically logs API call costs and timestamps
  • Easy integration with OpenAI's GPT-3.5-turbo and GPT-4 models
  • Lightweight and easy to use

Installation

To install openai_pricing_logger, run the following command in your terminal:

pip install openai_pricing_logger 

Usage

  1. Import the openai_api_listener context manager from the logger_package:
from logger_package import openai_api_listener
  1. Wrap your OpenAI API calls with the openai_api_listener context manager:
import openai

with openai_api_listener():
    # Your OpenAI API calls go here
  1. The package will automatically log the cost and timestamp of each API call to a file named api_calls.log in the current directory.

Contributing

Contributions are welcome! Please feel free to open issues and submit pull requests on the GitHub repository.

License

openai_pricing_logger is licensed under the MIT License.

About

๐Ÿš€ openai_pricing_logger: Track & log OpenAI API costs with ease. A Python package for monitoring GPT-3.5-turbo & GPT-4 usage costs. Lightweight, automatic cost logging. Ideal for developers, data scientists. OpenAI cost tracking, API logging, Python, GPT models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages