Moving image work into the browser took that bill to zero
For about two months last year I had a habit: check the API usage graph before anything else in the morning. Not because traffic was flattering — because every time that line went up I had to work out how much credit was left. Image processing on my site ran entirely through a third-party API, billed per call. Some background. I run a small tool site: users upload an image, something happens to…
Two months ago, I developed a habit of checking the API usage graph at the start of each day. This was not because traffic was impressive, but because every rising line forced me to calculate how much credit remained. My site processed images through third-party APIs, charging a few cents to tens of cents per operation. While inexpensive individually, my site's free access made it costly when many users engaged.
Background removal, an AI endpoint, was the most expensive single feature, accounting for over half my server costs in one month. To reduce expenses, I moved as much as possible into users' browsers using ImgIng. This involved compressing, converting formats, conducting AI background removal, and offering an animation workshop and multilingual OCR.
I also added an image editor, AI upscaling, and PDF processing, allowing these services to run in users' browsers on their devices. This shift to local processing meant the cost of operations went to zero, as the user's CPU and memory handled the work, and I only paid for static hosting and bandwidth. Consequently, the site became free and unmetered without accounts or watermarks.
ImgIng.ai explained that common formats processed locally incurred no extra cost for them, which I confirmed by checking DevTools. The user's device absorbed the cost, albeit at the expense of potentially slower performance on older machines. Although this change seemed advantageous, it also meant losing valuable data from the API dashboard and being locked into free services, as charging for computation running on users' laptops seemed impractical.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.