Simple Library for OpenAI Usage
Project description
openai-usage
Utilities to track OpenAI API usage.
Installation
pip install openai-usage
Usage
from openai_usage import Usage
# Track usage manually
usage = Usage()
usage.add(Usage(requests=1, input_tokens=10, output_tokens=20, total_tokens=30))
# Create from OpenAI object
from openai.types.completion_usage import CompletionUsage
openai_usage = CompletionUsage(prompt_tokens=10, completion_tokens=20, total_tokens=30)
usage = Usage.from_openai(openai_usage)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openai_usage-0.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_usage-0.1.0.tar.gz.
File metadata
- Download URL: openai_usage-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.11.13 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19d24dc78b14d9d723493898c676786c049fbb5a3fa000f1abd2b07c8d5d86eb
|
|
| MD5 |
58c478c7f80079622ce64c1fbaa12c81
|
|
| BLAKE2b-256 |
12f71dc7aca3753bbc511b6b57925a48cdd9f4140673d365ee5bd6323ee4229f
|
File details
Details for the file openai_usage-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openai_usage-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.11.13 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4679afabadb07f2e08d875a6727ed3dd004f5c5ba0fa290f07b5738ca648902
|
|
| MD5 |
923de9d4d1c11e4ae5080de589f241ed
|
|
| BLAKE2b-256 |
0389ce04a06299e08e29af0457bd2aa6454898d2de6fa6399847ef7a2d3571ed
|