A sleek web-based calculator where every single computation is performed by GPT-4o-mini. No local math — every time you press =, an API call is made to OpenAI, and the result is displayed along with the response latency.
Built as a fun demonstration of using an LLM for something absurdly simple.
- You type a math expression (e.g.
124 + 37) - You press
= - The expression is sent to OpenAI's GPT-4o-mini model
- The model responds with the numeric result
- The result and API latency (in milliseconds) are displayed
That's it. No eval(), no local arithmetic. Pure AI-powered math.
Go to platform.openai.com/api-keys and create a new API key.
Just open index.html in any browser. No server, no build step, no dependencies.
open index.htmlOn first load, you'll be prompted to enter your OpenAI API key. It's saved in your browser's localStorage and never leaves your machine except to call OpenAI. You can change it anytime via the gear icon in the top-right corner.
- AI-Powered — Every calculation goes through GPT-4o-mini
- Latency Display — Shows response time in milliseconds after each computation
- Loading Animation — Shimmer effect on the display while waiting for the API
- Keyboard Support — Use number keys, operators, Enter, Backspace, and Escape
- API Key Management — Settings gear icon to update your key at any time
- Mobile Responsive — Works on any screen size
- Dark UI — OLED-black design with neon blue accents and JetBrains Mono font
| Key | Action |
|---|---|
0-9 |
Input digits |
+ - * / % |
Operators |
. |
Decimal point |
Enter or = |
Compute |
Backspace |
Delete last character |
Escape or C |
Clear all |
- Single HTML file (vanilla JS + CSS)
- OpenAI Chat Completions API
- Google Fonts (JetBrains Mono)
GPT-4o-mini is extremely cheap. Each calculation uses ~50 tokens, costing roughly $0.00001 per computation. You'd need to make ~100,000 calculations to spend $1.
MIT