|
1 |
| -# openai-image-token-calculator |
| 1 | +# OpenAI Image Token Calculator |
| 2 | + |
| 3 | +The OpenAI Image Token Calculator is a simple application designed to estimate the number of tokens and the cost associated with processing images using OpenAI's GPT-4o and 4o-mini models. This tool helps users understand the how the tokens and cost is calculated based on the selected model's specifications and the number of images to be processed. |
| 4 | + |
| 5 | +**Use the app**: https://jamesmcroft.github.io/openai-image-token-calculator/ |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +1. **Select a Model**: Choose a model from the dropdown menu. |
| 10 | +1. **Add Images**: Input the height and width of the images you will process in a single request. A multiplier can be applied also if you are processing many images of the same size. |
| 11 | +1. **Calculate**: Click the "Calculate" button to get the token and cost estimates. |
| 12 | +1. **View Results**: The results will display the token estimate and cost estimate based on the selected model. |
| 13 | + |
| 14 | +## Running Locally |
| 15 | + |
| 16 | +### Prerequisites |
| 17 | + |
| 18 | +- [Node.js](https://nodejs.org/en/download/) installed on your machine (recommend using the LTS version) |
| 19 | + |
| 20 | +### Steps |
| 21 | + |
| 22 | +1. Clone the repository: |
| 23 | + |
| 24 | + ```bash |
| 25 | + git clone https://github.com/jamesmcroft/openai-image-token-calculator.git |
| 26 | + cd openai-image-token-calculator |
| 27 | + ``` |
| 28 | + |
| 29 | +2. Install the dependencies: |
| 30 | + |
| 31 | + ```bash |
| 32 | + npm install |
| 33 | + ``` |
| 34 | + |
| 35 | +3. Start the development server: |
| 36 | + |
| 37 | + ```bash |
| 38 | + npm run dev |
| 39 | + ``` |
| 40 | + |
| 41 | +4. Open your browser and navigate to the local server address (usually `http://localhost:5173`). |
| 42 | + |
| 43 | +## Building the Application |
| 44 | + |
| 45 | +To build the application for production, run the following command: |
| 46 | + |
| 47 | +```bash |
| 48 | +npm run build |
| 49 | +``` |
| 50 | + |
| 51 | +This will create a `dist` directory containing the compiled application. |
| 52 | + |
| 53 | +## Contributing |
| 54 | + |
| 55 | +Contributions are welcome! To contribute changes to the application: |
| 56 | + |
| 57 | +1. Fork the repository. |
| 58 | +2. Clone your forked repository. |
| 59 | +3. Create a new branch for your changes. |
| 60 | +4. Make your changes. |
| 61 | +5. Commit your changes. |
| 62 | +6. Push your changes to your forked repository. |
| 63 | +7. Create a pull request! |
| 64 | + |
| 65 | +## License |
| 66 | + |
| 67 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments