This tool is designed to help users estimate the pricing for OpenAI APIs based on the selected model and input parameters. It provides a convenient way to explore and understand the potential costs associated with different models and input scenarios.
- Python 3.10
- Required Python packages: Install requirements.txt
-
Clone the repository:
git clone https://github.com/your-username/openai-api-pricing-calculator.git
-
Navigate to the project directory:
cd openai-api-pricing-calculator
-
Install dependencies:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run main.py
-
The app will open in your default web browser. Select the model type, specific model class, and individual model using the sidebar.
-
Customize input parameters, such as resolution and dimensions, if applicable.
-
Enter your text in the provided textbox.
-
Click the "Pricing" button to calculate and display the estimated cost based on the selected model and input.
-
Optionally, use the "Clear" button to reset the text area.
The tool currently supports language models. Depending on the selected model, additional options for vision models may be available.
-
The tool uses configuration data loaded from a YAML file (
config.yaml
) to determine model attributes and pricing details. -
For more information on vision models and calculating costs, refer to OpenAI's documentation.
Feel free to contribute to the project by creating issues or submitting pull requests. Your feedback and improvements are welcome!