Updated
LLM API Pricing Calculator: Serverless vs GPU
A useful llm api pricing calculator needs only three inputs: tokens per request, requests per month, and what a GPU costs you per hour. This article gives the formula, worked numbers at $0.15 and $0.50 per 1M tokens, and a script you can edit.

Key points
- Serverless cost = input tokens x $0.15 + output tokens x $0.50, per million, and zero when idle.
- An always-on GPU costs the same every hour, busy or not.
- Break-even requests per month = monthly GPU cost / cost per request.
- At a $2 per hour GPU (an example, not a quote), break-even is about 2.65 million requests a month.
The two cost models
Serverless, per token. You pay for the tokens you send and receive, and nothing when the API is idle. On this service the price is $0.15 per 1M input tokens and $0.50 per 1M output tokens, from prepaid credit, with no subscription. Failed or refused requests are not charged.
Always-on GPU. You rent or own a machine that runs a model around the clock. The cost is a fixed number per hour, whether it serves a million requests or none. On top you carry the work of installing an inference server, updating it, monitoring it and planning for spikes.
The calculation compares a cost that grows with use against a cost that does not. Where the lines cross is the break-even point, and it tells you which model suits your traffic. See the serverless LLM API page for how the per-token service works.
Step 1: cost per request
Estimate the average tokens of one request. For a support bot, say 2,000 input tokens (instructions, history, new question) and 500 output tokens:
- Input: 2,000 x $0.15 / 1,000,000 = $0.0003
- Output: 500 x $0.50 / 1,000,000 = $0.00025
- Total: $0.00055 per request, or $550 per million requests
Your numbers will differ. Read the usage field of real responses for a day and use the averages. Estimates made from imagination are often off by a factor of two or more, usually because of chat history. Remember to count the system prompt in every request, and to include retries only if they succeed, since failed requests are not billed.
Step 2: monthly serverless cost
Multiply by volume. A month has about 730 hours, or 30 days when you think in days.
| Requests per month | Per day | Serverless cost at $0.00055 each |
|---|---|---|
| 30,000 | 1,000 | $16.50 |
| 300,000 | 10,000 | $165 |
| 3,000,000 | 100,000 | $1,650 |
| 30,000,000 | 1,000,000 | $16,500 |
Serverless cost is linear, so you can scale any row by simple multiplication. It also tracks real traffic: a quiet week costs little, and a launch-day spike costs exactly what the extra tokens add up to. If your traffic is seasonal or still unknown, that flexibility is worth real money, because you never pay for capacity you did not use. Prepaid credit never expires, so an unused balance simply stays available for the next busy month.
Step 3: monthly GPU cost and the break-even
For the GPU side you need your own number: what the machine costs per hour from the provider you would use, or the monthly amortized cost if you own it. This article does not quote GPU prices, because they change and vary by provider; check current pricing. The example below uses assumed hourly rates to show the method.
| Assumed GPU cost per hour | Monthly (x 730) | Break-even requests per month | Per day |
|---|---|---|---|
| $1 | $730 | 1,327,273 | about 44,200 |
| $2 | $1,460 | 2,654,545 | about 88,500 |
| $4 | $2,920 | 5,309,091 | about 177,000 |
The formula is break_even = monthly_gpu_cost / cost_per_request. At $2 per hour, $1,460 / $0.00055 gives about 2.65 million requests a month. In tokens, that is 2.65 million x 2,500 = about 6.64 billion tokens. Below that volume, per-token serverless is cheaper on cost alone. Above it, an always-on GPU can be cheaper, provided it is kept busy and can actually handle the load.
What the formula leaves out
The simple break-even flatters the GPU in several ways:
- Utilization. Break-even assumes the GPU is serving enough traffic to match the serverless volume. Real traffic has night-time lows and peaks. If the machine is idle half the time, its effective cost per token doubles.
- Capacity. One GPU serves a limited number of tokens per second. Verify that your model, quantization and batch size can serve the volume, or the break-even is irrelevant.
- Redundancy. A production service needs a second machine for failures and updates.
- Operations. Time spent on drivers, inference servers and monitoring has a cost, even if no invoice shows it.
It also leaves out things that favour the GPU: your data stays on your machine, you choose the exact model, and you have no per-key rate limits. A full key here allows 8 concurrent requests and 300 requests per minute, which is plenty for many products but a ceiling for some. If you need higher throughput, test whether it fits before you plan around it.
A calculator you can run
PRICE_IN, PRICE_OUT = 0.15, 0.50 # dollars per 1M tokens, serverless
HOURS = 730
def per_request(tokens_in, tokens_out):
return (tokens_in * PRICE_IN + tokens_out * PRICE_OUT) / 1_000_000
def compare(tokens_in, tokens_out, requests_per_month, gpu_per_hour, utilization=1.0):
serverless = per_request(tokens_in, tokens_out) * requests_per_month
gpu = gpu_per_hour * HOURS
break_even = gpu / per_request(tokens_in, tokens_out)
return {
"serverless_month": round(serverless, 2),
"gpu_month": round(gpu, 2),
"break_even_requests": int(break_even),
"gpu_effective_per_1m_tokens": round(
gpu / (requests_per_month * (tokens_in + tokens_out) / 1_000_000 * utilization), 2),
}
print(compare(2000, 500, 300_000, gpu_per_hour=2.0))
For 300,000 requests with the $2 example, it prints a serverless cost of $165 against $1,460 for the GPU, so serverless is far cheaper at that volume. The last field shows what you effectively pay per million tokens on the GPU at that load: $1,460 / 750 million tokens, about $1.95. Compare it with the blended serverless price. With four input tokens for every output token, that is (4 x $0.15 + $0.50) / 5 = $0.22 per 1M tokens.
A decision rule
- Under about a tenth of break-even volume, or traffic you cannot predict: use serverless. You avoid idle cost and operations.
- Near break-even with steady, round-the-clock traffic: run the numbers again with real utilization and the cost of a second machine.
- Well above break-even and a team that can run infrastructure: a dedicated GPU can pay off.
A third option is a mix: keep a dedicated GPU for the steady base load and send overflow to a per-token API, which also gives you a fallback when the machine is down. Because this API follows the OpenAI format, a router like that is a small amount of code. Many teams start serverless and revisit when the monthly bill gets large. To try the per-token route, claim the trial on the API key page, which gives $0.50 with one click, valid 7 days. Top-ups run from $20 to $500 with bonus credit from $50, listed on the pricing page. The API is OpenAI-compatible, so switching later in either direction means changing a base URL. The AI models API page explains which model you get: one open-weight model, model ID uncensored, text only, with a 100,000-token context window.
More guides
Questions and answers
Read the docsHow much does one request cost on this API?
It depends on tokens. A request with 2,000 input and 500 output tokens costs $0.00055.
Is serverless always cheaper than renting a GPU?
No. At high, steady volume an always-on GPU can win. Compute the break-even for your own token counts and GPU price.
Do I pay when the API is idle?
No. You pay only for tokens used, from prepaid credit that never expires.
Does the calculator include the cost of failed requests?
Failed or refused requests are not charged, so you can leave them out.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.