Cheapest AI API Cost: Per-Token Math and Examples
The cheapest ai api cost is the one you can calculate on paper before sending a single request. This page shows the per-token arithmetic for this API and a method for comparing it with any other provider.
Updated
Key points
- Rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens, billed from prepaid credit.
- Output tokens cost about 3.3 times as much as input tokens, so shorter replies save more than shorter prompts.
- Failed or refused requests are not charged, and credit never expires.
- Top-ups of $50 and up add a 5%, 10% or 15% bonus, which lowers your effective rate.

Short answer: price your own tokens, not a headline rate
The cheapest ai api cost for you depends on three numbers: how many tokens go in, how many come out, and what the provider charges per million of each. A low input price means little if your workload produces long answers, and a low output price means little if every call carries a 30,000-token prompt.
On this API the rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens. You pay from prepaid credit, there is no subscription, and a request that fails or is refused is not charged. The rest of this page turns those two rates into real numbers so you can decide with a calculator instead of a pricing page.
The formula
Every request costs:
cost = (input_tokens x 0.15 / 1,000,000) + (output_tokens x 0.50 / 1,000,000)
Tokens are counted by the model's tokenizer, not by words. As a rough rule for English text, one token is a bit under one word, but code, other languages and heavy punctuation use more. Do not guess: every response includes a usage object with the exact prompt and completion token counts, and with streaming the usage arrives at the end of the stream. Log it per request and your real cost per call becomes a measured figure.
The X-Balance-USD response header shows your remaining credit after each call, which is handy for a quick sanity check while you test.
Worked examples at these rates
Here are five common shapes of workload, with the math shown. Input cost is tokens x 0.15 / 1,000,000, output cost is tokens x 0.50 / 1,000,000.
| Workload | Input / output tokens | Cost per call | Volume | Total |
|---|---|---|---|---|
| Chat turn with short history | 2,000 / 500 | $0.0003 + $0.00025 = $0.00055 | 10,000 calls | $5.50 |
| Document summary | 20,000 / 1,000 | $0.003 + $0.0005 = $0.0035 | 1,000 docs | $3.50 |
| Long-context analysis | 90,000 / 2,000 | $0.0135 + $0.001 = $0.0145 | 100 calls | $1.45 |
| Bulk text generation | 500 / 1,500 | $0.000075 + $0.00075 = $0.000825 | 100,000 calls | $82.50 |
| Batch job, totals only | 50M / 10M | $7.50 + $5.00 | one job | $12.50 |
Two things stand out. First, even the 100,000-call generation job lands at $82.50, which is a number you can budget for. Second, in the bulk generation row the output is over 90% of the bill ($0.00075 of $0.000825), because output tokens are priced at 0.50 / 0.15, about 3.3 times the input rate.
What the minimum top-up buys
The smallest top-up is $20. At the chat-turn cost above, $20 pays for about 36,000 turns ($20 / $0.00055 is roughly 36,364). If you only sent input, $20 would cover about 133 million tokens; if you only generated output, about 40 million.
How to compare providers honestly
Price pages are written to look good, so compare on a fixed workload instead. A method that holds up:
- Pick one real workload, such as the chat turn above, and measure its input and output token counts from your own logs.
- Open each provider's current pricing page and write down the input and output rates for the exact model you would use. Rates change, so check their current pricing on the day you decide rather than relying on a blog post, including this one.
- Compute the cost per call with the formula, then multiply by your monthly volume.
- Add the costs that do not show up per token: minimum top-ups or subscriptions, expiry of unused credit, charges for failed requests, and rate limits that force you onto a higher tier.
Be careful with the word "model" in that step. This service runs one open-weight model, tuned to answer without content refusals for lawful adult use, hosted by an independent provider. It is not a router across vendors and it is not the official API of any lab. If your task needs a specific proprietary model, the cheapest rate on a different model does not help you, and the right choice is the one that does the job. If an open-weight model is enough, per-token cost is where this API is aimed.
Top-up bonuses change the effective rate
Top-ups are any whole amount from $20 to $500, with a bonus that scales with the size:
- $50 to $99: +5%, so $50 becomes $52.50 of credit.
- $100 to $199: +10%, so $100 becomes $110.
- $200 and above: +15%, so $200 becomes $230.
At the top bonus you receive $1.15 of credit per $1 paid, so the effective rates drop to $0.15 / 1.15 = about $0.130 per 1M input tokens and $0.50 / 1.15 = about $0.435 per 1M output tokens. That is a 13% saving without changing a line of code. Because credit never expires, buying a larger block is low-risk if you expect steady use.
Payment is by crypto only: USDT on TRC20 or USDC on Base. Details are on the pricing page, and a longer breakdown of the pay-as-you-go model is in pay-as-you-go LLM API pricing.
Seven ways to lower the bill
The cheapest rate still rewards careful use. In rough order of impact:
- Cap and shape the output. Output costs 3.3 times more per token. Ask for concise answers in the system prompt and set
max_tokenswhere you know a sensible ceiling. - Trim chat history. Resending 20 turns every call multiplies your input cost. Keep a rolling window or a short summary of older turns.
- Do not stuff the context window. The window is 100,000 tokens, but a 90,000-token prompt costs $0.0135 every time. Retrieve the relevant passages instead of pasting the whole file.
- Use JSON mode for extraction. With
response_formatset tojson_objectyou avoid wordy preambles and retries caused by malformed output. - Lower the temperature for deterministic tasks. Fewer off-target generations means fewer re-runs.
- Stop early. Use
stopsequences so the model does not keep writing after the part you need. - Test on the trial credit. New users can claim $0.50 with one click on the API key page, valid for 7 days. At the chat-turn cost that is about 900 calls, enough to measure your real token counts before you fund anything.
A monthly budget example
Suppose you run a support assistant that handles 3,000 conversations a day. Each conversation takes 6 model calls, and a typical call sends 2,000 input tokens and returns 300 output tokens.
- One call: 2,000 x 0.15 / 1,000,000 = $0.0003 for input, plus 300 x 0.50 / 1,000,000 = $0.00015 for output, so $0.00045.
- One conversation: 6 x $0.00045 = $0.0027.
- One day: 3,000 x $0.0027 = $8.10.
- Thirty days: 30 x $8.10 = $243.
The load is 18,000 calls a day, which averages 12.5 per minute, comfortably inside the 300 requests per minute that a full key allows. If you fund the month with a $200 top-up, the 15% bonus gives you $230 of credit, so one top-up covers about 28 days of this traffic ($230 / $8.10 is roughly 28.4). Because unused credit never expires, you can top up in whatever amounts suit your cash flow and carry any leftover forward.
Treat this as a template and swap in your own numbers. The point is that the whole bill reduces to four inputs you can measure: calls per day, input tokens per call, output tokens per call, and the two rates.
Check the call with a measurement
This script sends one request and prints the exact cost from the usage it reports. Replace the key with your own.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.unlimitedaiapi.com/v1",
api_key=os.environ["UNLIMITED_API_KEY"],
)
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarize the idea of per-token pricing in two sentences."}],
)
u = resp.usage
cost = u.prompt_tokens * 0.15 / 1_000_000 + u.completion_tokens * 0.50 / 1_000_000
print(resp.choices[0].message.content)
print(u.prompt_tokens, u.completion_tokens, f"${cost:.6f}")
Run it on a handful of representative prompts, average the result, and scale to your volume. If you have not set up access yet, the quickstart in the docs covers it, and you can get an API key in a couple of minutes.
More guides
Questions and answers
What does one million tokens cost on this API?
Input is $0.15 per 1M tokens and output is $0.50 per 1M tokens. One million of each together costs $0.65.
Do I pay for failed or refused requests?
No. Failed or refused requests are not charged, so retries after an error do not add to the bill.
Does my credit expire?
No. Credit never expires, and there is no subscription or monthly minimum. You pay as you go from the balance you top up.
Is this the cheapest option for every project?
Not necessarily. It serves one open-weight model, so if you need a particular proprietary model, compare its current pricing and quality directly. For tasks where an open-weight model is enough, per-token cost is the main advantage.
Can I try it before paying?
Yes. New users can claim $0.50 of trial credit with one click on the API key page after sign-up. It is valid for 7 days and is limited to one per person.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.