AI API Cost Calculator

Work out what an AI feature will cost before you build it. You type the price per million input and output tokens from your provider's price page, how many tokens a typical request uses, and how many requests you expect per day. The calculator returns the cost per request, per day, per month and per user, and can compare a second price list side by side. No prices are built in, so it never goes out of date.

What you enter

What you get

How it works

  1. Look up the price per million input tokens and per million output tokens for the service you plan to use, and type them in. Replace the starting numbers, which are only placeholders.
  2. Enter how many tokens an average request sends in and gets back, or paste a sample prompt and let the tool estimate its tokens at about four characters per token.
  3. Add requests per day, the number of users and how many days a month you expect traffic. If your provider charges less for cached input, enter the cached share and its price.
  4. Optionally type a second pair of prices to compare, then read the cost per request, day, month and year, and the cost per 1,000 users.

Where the money goes in an AI feature

Most providers bill by the token, with separate prices for what you send (input) and what comes back (output). A token is a chunk of text, roughly three quarters of an English word. Because the two prices differ, you need four numbers to price a request: input tokens, output tokens, input price and output price.

Volume then does the rest. A request that costs a fraction of a cent looks harmless until it runs 50,000 times a day. Multiply the cost per request by daily requests and by the days in a month, and compare the total with what each user pays you. If the monthly cost per user is close to your price per user, the feature needs a cheaper setup or a limit.

Ways to bring the number down

Shorten what you send. Long instructions, big pasted documents and full chat histories are input tokens you pay for on every call. Trimming a 3,000-token prompt to 1,500 cuts the input cost in half, and if your provider offers cheaper cached input, putting the unchanging part of the prompt first lets more of it be cached.

Cap the output. A maximum length on answers protects you from rare, very long responses, which cost the most per token. You can also use a smaller, cheaper option for easy requests and keep the expensive one for hard cases. Use the comparison box to see what that split would save over a month.

Tips

Frequently asked questions

How is the cost of an AI API request calculated?

Cost = (input tokens x input price + output tokens x output price) / 1,000,000, with prices quoted per million tokens. A request with 1,000 input tokens and 500 output tokens at 1 and 2 per million costs (1,000 x 1 + 500 x 2) / 1,000,000 = 0.002.

Why are there no prices built into this calculator?

Prices change often and differ between providers, models and plans. A built-in table would be wrong sooner or later, so you type the numbers from your provider's current price page. The starting values are placeholders to show how the tool works.

How does the cached share change the cost?

Some providers charge a lower price for input tokens that are repeated from an earlier request. Enter the share of your input that is cached and the cached price. The input cost becomes input tokens x ((1 - share) x input price + share x cached price). With a 50 percent share and a cached price of 0.25 against an input price of 1, the input price falls to an average of 0.625.

How accurate is the token estimate from pasted text?

It divides the number of characters by four and rounds up, which is a common rule of thumb for English. It can be off by 20 percent or more for code, numbers or non-English text. Use it for planning and check real counts with your provider's tool before you commit to a budget.

Is the monthly figure a quote or a guarantee?

No. It multiplies the numbers you entered. Real bills depend on actual usage, rate plans, taxes and fees, so treat the result as an estimate and not as financial advice.

Related: SaaS metrics calculator, Burn rate calculator, ROI calculator.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap