NashTech Blog

How Much Does an AI Feature Cost? A Case Study of an English Writing Assistant

Table of Contents

How Much Does an AI Feature Cost? A Case Study of an English Writing Assistant

A writing assistant corrects two verbs in a ten-word sentence. What should a team put in its budget for that interaction? The writer sees two edits. The model receives instructions and the original sentence, then generates a complete replacement. A team estimating cost from the words that changed would miss most of the work.

I measured that gap using WriteBetter AI, a small English writing assistant I built. It checks spelling in the browser and can send a completed sentence to Gemini for a suggested rewrite. That gives us a concrete unit to price: one sentence submitted for review. It also gives us a way to examine a question that often comes up alongside cost. If we replace the provider key with a user login, a cloud identity or a model on the writer’s laptop, who supplies the compute and who pays for it?

Explore the WriteBetter AI source code on GitHub

Measure a real request

I ran the existing Next.js route handler with its usual prompt, response schema and Gemini 3.1 Flash-Lite endpoint. For this experiment I inspected the provider’s response before the handler reduced it to the replacement string. The following figures came from a fresh successful request on November 27, 2026. Route at the tested revision

What I sent or observedValue
SentenceYesterday I go to the office and meet my team.
ReplacementYesterday I went to the office and met my team.
Prompt tokens60
Candidate tokens20
Total tokens80

The ten words in the sentence reached the provider inside a larger request. Each call also carries a system instruction describing what to correct and preserve. The response contains a complete sentence in a JSON object. Estimating usage by counting the two changed verbs would miss most of the work. If you reproduce this experiment, read the response’s usageMetadata before discarding the provider payload. The application can record numeric counts without retaining the writer’s sentence. Gemini token counting

Turn the measurement into a budget

On November 27, 2026, Google’s standard paid text rates for this model were USD 0.25 per million input tokens and USD 1.50 per million output tokens, including thinking tokens where applicable. The response above reported 60 prompt tokens and 20 candidate tokens, with no additional thinking-token count. Google also lists free input and output on its free tier, subject to availability and quota. Model pricing · Rate limits

Applying the two rates separately gives the estimated charge for one review.

Input    60 × $0.25 / 1,000,000 = $0.000015
Output   20 × $1.50 / 1,000,000 = $0.000030
Total                             $0.000045
Illustrative workload at the same token countsReviewsEstimated paid model cost
One writing session40$0.0018
One writer, 40 reviews on each of 20 working days800$0.036
100 writers with that monthly usage80,000$3.60

These figures are projections from one short sentence. I did not inspect a billing statement. A longer paragraph, additional context, a model that produces more output, or a different rate would change the result. The table covers model usage only. The demo ran on an existing computer. A public deployment would also need a hosting budget and a decision about who pays when strangers submit work.

For a personal prototype on the free tier, the first constraint can be availability: the next sentence may have to wait when the project reaches a limit. There is a separate consideration for drafts. Google lists content use for product improvement on the free tier, so I would check the applicable terms before enabling it for unpublished client material. Gemini pricing and data use

Count reviews, including the ones the writer never accepts

The editor waits for a sentence boundary, pauses for half a second and reuses the result for identical wording in the current session. In a browser test with controlled replies, two identical sentences produced two suggestion cards from one request. Adding unfinished words after a submitted sentence also left the request count at one. Changing the submitted sentence while its review was pending produced a second request for the new wording.

This makes the number of dispatched reviews a better starting point for a budget than keystrokes or clicks on Apply. A perfectly correct sentence still needs a model response before the editor can decide to stay quiet. A dismissal happens after inference. And when the browser abandons a stale response, its cancellation alone tells us nothing about how much work the provider completed. To estimate real monthly usage, I would collect completed token totals, track interrupted requests separately, and reconcile both with the project’s usage dashboard.

Three ways to connect without handing the app a provider key

Version 0.3.0 has two working modes: the browser’s local dictionary and the server-side Gemini key. The following alternatives would each require a different integration. Choosing among them depends on whose machine performs the work and whose account carries the usage.

1. Use an existing ChatGPT sign-in through Codex for a personal workstation. A local adapter could submit one sentence through codex exec and parse a structured reply. I tried the command with a signed-in ChatGPT account. One attempt timed out after 90 seconds. A diagnostic retry returned HTTP 429. We obtained no corrected sentence or successful latency measurement from that trial. An eligible user’s Codex allowance and any subscription cost would still matter. I would test successful response times before relying on this path during typing. A public website would need its own authorization and capacity design before serving multiple writers. Codex authentication · Non-interactive Codex

2. Use a Google Cloud identity for a team deployment. A backend can obtain Application Default Credentials from a developer login on a workstation or an attached service account in Google Cloud. This is useful when a team wants centrally managed permissions and project billing. WriteBetter AI currently posts to the Gemini Developer API with an API-key header. A cloud-identity version would need a compatible Google Cloud model endpoint, project configuration and an authorized identity. Budget it against that service’s rates. The Gemini Developer API free-tier assumption in the example above does not carry over automatically. I have not run this configuration in the project. Google Cloud authentication for model requests

3. Run a downloaded model locally with Ollama. A local adapter could call Ollama on the same computer and request a structured sentence replacement. Its local endpoint requires no API key. With a local model, inference uses the machine’s memory, compute and electricity, and the writer can keep the draft on that machine. A simple cost measurement would be incremental power at the wall multiplied by active hours and the electricity tariff. For example, an assumed extra 60 watts for 10 hours at $0.20 per kilowatt-hour is $0.12 in electricity. Hardware cost is additional. I have not measured wattage, correction quality or latency for this path. For a hosted app, remember that localhost on the backend refers to the hosting machine. Ollama local authentication · Structured output

What to measure in your own application

Start with one action a user can recognize: a sentence reviewed, a document summarized or a question answered. Trace it through the application. How many model requests did it trigger? Which response fields report billable usage? Then repeat the measurement on the mix of inputs people actually use. Multiplying that sample by expected traffic gives a budget you can test against the provider’s usage dashboard.

For a writing assistant, I would also count how many proposed corrections the writer accepts. Suppose the editor spends $1 reviewing a batch of drafts. If writers accept 200 corrections, that is half a cent per accepted correction. If they accept 20, it is five cents. Both sessions can have the same token bill and very different outcomes. Keep latency and correction quality beside that number to understand why suggestions go unused.

On my workstation, the dictionary already handles a typo without a model call. Gemini earns its place when a sentence needs context. For a team deployment, a managed identity would put access and billing under the team’s cloud project. For confidential drafts, a local model would be worth testing against the same sentences. Each choice follows from the workload, the data and who will operate it. The API key is just one part of that decision.

Picture of chanhnguyentrung

chanhnguyentrung

Suggested Article

Scroll to Top