Skip to content

Commit f7f8447

Browse files
committed
Update README.md
1 parent 527c60a commit f7f8447

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,67 @@
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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite -m dev --host 0.0.0.0",
8-
"build": "vite build -m prod --base=/static/app/",
8+
"build": "vite build -m prod --base=/",
99
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview"
1111
},

0 commit comments

Comments
 (0)