I keep getting a version of the same question.
A store owner wants product descriptions generated automatically. A founder wants a support bot on their Shopify store. Someone watched a demo and now wants “ChatGPT on our site.” Then they ask what it costs.
Nine times out of ten, the number in their head is $20 a month. That is ChatGPT Plus — a person in a chat box. An AI API is a meter. You pay for what you send and what you get back. AI API cost stays quiet until traffic, retries, and a long system prompt land on the same invoice.
Here is the walkthrough I use before I write an integration — or skip ahead and plug your volume into the AI API cost calculator.
What you are actually buying: tokens
A token is a chunk of text. In English, 100 tokens is roughly 75 words. A 400-word product description is about 530 tokens; a brand-voice system prompt can hit 800–1,500 before the model has even seen the product.
Every call is two piles:
- Input tokens: system prompt, user message, chat history, retrieved docs, tool results
- Output tokens: whatever the model writes, including JSON, refusals, and (on reasoning models) hidden “thinking”
Providers price per 1 million tokens, split by direction. Tokens per request × requests per month is the bill.
Sizing I use on scoping calls:
- Classification or tagging: 200–400 input, 20–80 output
- Product description: 800–1,500 input, 250–500 output
- Support turn with history and retrieved policy: 2,000–6,000 input, 150–400 output
- “Read this PDF and extract a table”: tens of thousands of input tokens in one shot
If you are guessing, paste a typical prompt into a tokenizer. Do not size a budget from a happy-path demo.
Input vs output: why the split drives AI API cost
Public list rates, USD per 1 million tokens, matching my calculator as of 12 September 2026. Verify with the provider — caching, batch, and context tiers change the live bill.
- GPT-4o: $2.50 in / $10.00 out
- GPT-4o mini: $0.15 in / $0.60 out
- Claude Sonnet 4: $3.00 in / $15.00 out
- Claude Haiku 4.5: $1.00 in / $5.00 out
- Gemini 2.0 Flash: $0.10 in / $0.40 out (approximate; confirm availability)
Output is typically three to five times the input price. That changes how you design the call.
A fat system prompt is input. It is cheaper per token than the essay you asked for — but you send it on every request. A 1,200-token preamble on 50,000 monthly calls is 60 million input tokens. On GPT-4o that is $150 a month before anyone has generated a word of customer-facing copy.
Ask for “a detailed, SEO-rich, 600-word description plus FAQs plus metafield JSON” and you just multiplied the expensive direction. Two habits that pay for themselves:
- Keep the system prompt tight. When policy gets long, retrieve the relevant slice instead of pasting the handbook.
- Cap max output tokens. If you only need a JSON object with five fields, do not leave the model free to write a blog post.
Reasoning models add a twist: hidden thinking is usually billed as output. A “cheap” reasoning call can cost more than a larger chat model if it thinks for 2,000 tokens to produce 80 tokens of answer.
Worked example: a catalog job vs a support bot
I run two estimates on purpose. In a kickoff they sound like the same feature. On the invoice they are not.
Example A — Shopify product descriptions (one-shot)
2,000 products. Each call sends an 800-token instruction plus 400 tokens of title, vendor specs, and tags. The model returns about 350 tokens: description, bullets, SEO title.
- Input: 2,000 × 1,200 = 2.4 million tokens
- Output: 2,000 × 350 = 0.7 million tokens
On GPT-4o: 2.4 × $2.50 + 0.7 × $10.00 = $13.00 for the whole catalog. On GPT-4o mini: $0.78.
That number makes people relax. For a one-time rewrite, they should. The risk is the pipeline you actually ship: a metafields call, a vision pass, a QA rewrite (I budget 20–40% extra), and re-runs when a dirty vendor feed updates. Three calls per product plus a 30% rewrite rate turns $13 into $50–$70 on GPT-4o — still fine for a catalog, and still worth modeling.
Example B — store support chatbot (this is where the meter runs)
Same merchant, different feature: a bot that answers “where’s my order,” size questions, and return policy.
- 3,000 conversations a month
- 8 turns each (it always looks like 3 turns in the demo)
- About 4,000 input tokens per turn (system prompt + retrieved policy or order snippet + growing history)
- About 300 output tokens per turn
Monthly tokens: 3,000 × 8 × 4,000 = 96 million input, and 3,000 × 8 × 300 = 7.2 million output.
Same models, same month:
- GPT-4o: 96 × $2.50 + 7.2 × $10.00 = $312
- Claude Sonnet 4: 96 × $3.00 + 7.2 × $15.00 = $396
- GPT-4o mini: 96 × $0.15 + 7.2 × $0.60 = about $19
- Gemini 2.0 Flash: 96 × $0.10 + 7.2 × $0.40 = about $12
That gap — twelve dollars versus three or four hundred — is the conversation I want you to have before you pick a default model. The expensive model is not wrong. Using it for every “what’s your return window?” message is. Change the volume or the mix in the AI API cost calculator.
Hidden costs: the bill that was not in the proposal
A Shopify merchant asked me to “just add ChatGPT” so new products would get descriptions automatically. In their head it was a Plus subscription. We dry-ran a handful of SKUs. The first prompt stuffed the entire vendor spec sheet, three few-shot examples, and a brand-voice essay into every call. That would have been okay — input is the cheaper side. Then they wanted a vision pass on every image, and a rewrite loop “until it sounds premium.” No output cap. No cheap model for the first draft. No stop condition.
I no longer treat that as scope creep. That is the product. If you do not price the loop, you did not price the feature — same as a third-party app fee on a theme build.
Embeddings, retries, logging
If the bot answers from your policy or catalog, you embed those docs and each query. Embedding is cheap next to generation, but retrieval inflates input: those 2,000 tokens of “relevant chunks” ride along on every turn. Generation is still the line that hurts.
Networks fail, JSON does not parse, the merchant clicks regenerate. A 15% retry rate is a 15% tax. An agent that calls tools three times per question is three generations, not one. Full-prompt logging and nightly evals (200 golden questions) are real line items — useful, and they belong in the forecast.
Vision is not “one image = one token,” and audio is often priced per minute. If the demo was multimodal, the estimate should be too.
The good hidden costs: prompt caching on a stable system prefix, and batch APIs for catalog jobs that can wait overnight. Neither helps a live chat turn.
When I reach for the cheaper model on purpose
I do not start every feature on the flagship model. I start on the smallest model that can do the job, then promote only the cases that fail.
- Classification and routing (“is this a refund question?”) — mini / Haiku / Flash.
- First-draft catalog copy and metafield JSON — mini or Flash with a schema. Promote to 4o or Sonnet only if the draft fails the checklist.
- Support answers that cite policy — a mid-tier model, tight retrieval, refuse when retrieval is empty. Do not let a flagship model invent shipping rules.
- Hard reasoning, messy vendor PDFs, multi-step agents — mid or flagship, and I cap the number of steps.
- Brand-sensitive, customer-facing copy — generate cheap, review with a better model or a human, then ship.
The router itself is a cheap classification call — one of the better trades in this stack. And stop sending the whole conversation when you only need the last message plus a summary.
How I estimate before I write code
When I scope AI work from Karachi, the line item is not “AI feature: $X.” It is five numbers: tokens in and out per success, daily volume including failures, default vs upgrade model, extras (embeddings, vision, evals, logging), and the bill if usage is 3× the demo.
I would rather show $15–$40 versus $300–$500 than say “APIs are cheap now.” Put those numbers in the proposal. If the invoice already surprised you, start with the model mix, the system-prompt length, and the retry loop.
Run your own AI API cost numbers
I built a calculator so I could stop doing this on paper every time a kickoff landed at 1 a.m.
Open the AI API cost calculator — pick a model, enter tokens per request and monthly volume, and compare GPT-4o, Claude, and Gemini on the same workload. Rates are approximate public list prices. Verify with your provider before you commit a budget.
If you want help turning a “we should add AI” idea into a scoped pipeline with a real cost ceiling, that is the work I do: Shopify themes, React and Next.js, and AI agents that are allowed to have a budget.
Model your own numbers
Use the free calculator for OpenAI, Claude, and Gemini — tokens or credits, including custom models.