Best LLM API Guide
LLM API Pricing Comparison: How to Compare Fairly
An LLM API pricing comparison only works if every provider is priced against the same workload, not the same headline number. This article gives you a short method, then runs it at $0.15 per 1M input tokens and $0.50 per 1M output tokens.
Updated:


Key points
- Price a real request shape (input tokens, output tokens, turns), not a per-million headline.
- Output tokens usually cost more than input tokens, so a chatty workload changes the ranking.
- Minimum top-ups, expiry and failed-request billing change what a dollar actually buys.
- At $0.15 in and $0.50 out, a 1,500-in / 400-out request costs $0.000425.
The four numbers every price list hides
Most price pages show two figures: dollars per million input tokens and dollars per million output tokens. Those two numbers are enough to compare providers, but only after you add two more that come from your own app: how many tokens you send per request and how many you get back.
- Input price per 1M tokens. This covers your system prompt, chat history and any documents you paste.
- Output price per 1M tokens. This covers everything the model writes back.
- Your input size per request, including history that is resent each turn.
- Your output size per request, which depends on how long you let replies run.
Cost per request is input_tokens x input_price / 1,000,000 + output_tokens x output_price / 1,000,000. Everything else in this article is a refinement of that line.
Step 1: write down a request shape
Pick the three or four request types your product actually sends. A support bot, a story writer and a batch classifier have very different shapes, and a provider that wins on one can lose on another.
| Shape | Input tokens | Output tokens |
|---|---|---|
| Short chat turn | 1,500 | 400 |
| Long document summary | 50,000 | 1,000 |
| Classifier call | 300 | 20 |
| Long-form writing | 800 | 3,000 |
If you do not have logs yet, take a few real conversations and count tokens with any tokenizer. A rough rule is that one token is about four characters of English, but code and non-English text run higher. Measure before you trust the rule.
Step 2: run the math at $0.15 and $0.50
This service charges $0.15 per 1M input tokens and $0.50 per 1M output tokens. That is $0.00015 per 1,000 input tokens and $0.0005 per 1,000 output tokens. Applied to the shapes above:
| Shape | Input cost | Output cost | Per request |
|---|---|---|---|
| Short chat turn | $0.000225 | $0.0002 | $0.000425 |
| Long document summary | $0.0075 | $0.0005 | $0.008 |
| Classifier call | $0.000045 | $0.00001 | $0.000055 |
| Long-form writing | $0.00012 | $0.0015 | $0.00162 |
Notice where the money goes. In the document summary, input is 94% of the bill. In long-form writing, output is 93%. A provider with a cheap input price and an expensive output price looks great on the first workload and poor on the second. This is why a single "price per million" figure misleads.
Scale it to a month. A chat app that sends 1,000 short turns a day for 30 days sends 45M input tokens ($6.75) and 12M output tokens ($6.00), a total of $12.75.
Step 3: account for history that grows
Chat APIs are stateless. Each turn you resend the system prompt and every earlier message, so input grows with the length of the conversation while output per turn stays flat.
Take a 10-turn conversation with a 1,000-token system prompt. Each turn adds about 300 tokens from the user and 200 from the model, so 500 tokens of new history per turn. Turn 1 sends 1,000 input tokens, turn 2 sends 1,500, and turn 10 sends 5,500. The sum across 10 turns is 32,500 input tokens, plus 2,000 output tokens in total.
input_tokens = sum(1000 + 500 * k for k in range(10)) # 32,500
output_tokens = 10 * 200 # 2,000
cost = input_tokens * 0.15 / 1e6 + output_tokens * 0.50 / 1e6
print(round(cost, 6)) # 0.005875
That is $0.005875 for the whole conversation. If you only multiplied one turn by ten you would have undercounted the input by more than half. Trim history, summarize old turns, or cap the window if the number matters to you. The guide to using an LLM API covers how message history is sent.
Step 4: check the rules around the price
Two providers with the same token prices can still cost different amounts per useful answer. Check these before you decide:
- Context window. A larger window lets you skip chunking, but you pay input price for every token you send. This service has a 100,000-token window shared by prompt and completion.
- Minimum purchase. Here you top up any whole amount from $20 to $500. A $20 minimum buys about 47,000 short chat turns at the rate above ($20 / $0.000425).
- Expiry. Credit here never expires. Some providers expire prepaid balances or require a subscription, so check their current terms.
- Failed requests. Failed or refused requests are not charged here. Look for the same statement elsewhere.
- Rate limits. A full key allows 8 concurrent requests and 300 per minute. A cheap price is no use if your batch job cannot finish.
Volume bonuses also lower the effective price. A $200 top-up gets +15%, so you receive $230 of credit and your effective rates fall to about $0.13 input and $0.43 output per 1M. A $100 top-up gets +10%, and $50 gets +5%. Full details are on the pricing page.
When the cheapest price is not the right pick
Price per token ignores quality. A model that needs two attempts to get a correct answer costs twice as much per useful result, and a model that refuses your request costs you time even when the bill is zero. Run the same 20 to 50 real prompts through each candidate and count how many answers you would actually ship. Divide the total spend by that count.
The model here is a single open-weight model tuned to answer without content refusals for lawful adult use. It is not a router and it is not the official API of any model vendor. If your task needs the strongest reasoning available and refusals are not an issue, a larger model from another provider may give a better cost per accepted answer even at a higher token price. Check their current pricing and test it the same way.
A quick way to test the numbers yourself
You do not need to guess. Every response carries an X-Balance-USD header, and the API also reports token usage, so you can send your real prompts and read the actual cost. The Python below uses the OpenAI SDK against this service and prints the usage block.
from openai import OpenAI
client = OpenAI(base_url="https://api.bestllmapi.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarize the pros and cons of prepaid API credit."}],
)
u = resp.usage
cost = u.prompt_tokens * 0.15 / 1e6 + u.completion_tokens * 0.50 / 1e6
print(u.prompt_tokens, u.completion_tokens, round(cost, 6))
New accounts can claim $0.50 of trial credit with one click on the API key page. At the 1,500-in / 400-out shape that covers roughly 1,170 requests, enough to benchmark honestly. If you want to see whether a free tier is enough for you first, read about free LLM API options.
More guides
Questions to ask about any free tier
Free offers differ a lot, and the headline rarely tells you what matters. Before you build on one, ask these questions, and find the answers in the provider's own documentation.
- Which model is it? Some free tiers use a smaller model than the paid one. A test on a weak model tells you little about production.
- What are the rate limits? A limit of a few requests per minute is fine for a script and useless for a chat app with several users.
- Does it expire? A one-time allowance with a deadline is a different thing from a recurring monthly one.
- What happens to your prompts? If the data is used for training, do not paste anything private into it. Here, prompts are not used for training.
- What does the paid path look like? Moving from free to paid should be a change of account state, not a rewrite.
Self-hosting an open-weight model is sometimes suggested as the free route. The software may cost nothing, but the GPU you need to run a capable model does, whether you rent it by the hour or buy it. For a small project the arithmetic usually favours paying per token, because you pay only for what you use and nothing while idle.
Reading the trial as a test budget
It helps to treat the trial as a test budget rather than a free product. Spend it in a fixed order: first a handful of plain requests to confirm the connection, then your real prompt on ten varied inputs, then a streaming run, then one deliberately large prompt to see how the model handles long context. Keep the numbers from the usage block in a note.
After that you know your average input size, your average output size and your real cost per task. Multiply by the traffic you expect and you have a monthly figure that rests on measurements, not guesses. If the figure is acceptable, a $20 top-up is the next step. If not, you learned that for a few cents.
After the trial: what paying looks like
When the trial runs out or expires, you add prepaid credit. Any whole amount from $20 to $500 works. Larger top-ups carry a bonus: +5% from $50, +10% from $100, +15% from $200. A $100 top-up becomes $110 of credit, and $200 becomes $230.
You can pay by crypto (USDT on TRC20, USDC on Base). There is no subscription and no monthly minimum. The credit never expires, so a $20 top-up that you use slowly is not wasted. Each response includes an X-Balance-USD header, which lets your own code watch the balance without a dashboard.
Failed or refused requests are not charged. If a request errors out, you do not pay for it. Prompts are not used for training. See pricing for the full table.
Cheap ways to make credit last
You do not need tricks, only a few habits.
- Trim history. Keep the last N turns plus a short summary of older ones instead of resending everything.
- Set a
max_tokensceiling on tasks where short answers are enough. It is optional here, but it caps the output side, which is the more expensive one per token. - Use JSON mode (
response_formatwithjson_object) for extraction tasks so you do not pay for chatty preambles. - Test with small inputs first. Prove the prompt on ten examples before you run ten thousand.
- Handle 429s with backoff. Retrying in a tight loop on a trial key (2 concurrent, 60 per minute) wastes your own time. Wait for the
Retry-Afterheader when it is there.
If you are comparing options before spending anything, the page on Hugging Face Inference API versus this endpoint covers a related decision.
A first call to spend the trial on
Here is a minimal request. Replace the key with the one from your dashboard.
curl https://api.bestllmapi.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "uncensored", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
The response includes a usage block with prompt and completion token counts. Multiply those by the prices above and you have the exact cost of the call. Do that a few times and you will develop a feel for your own workload, which is worth more than any estimate. The quickstart docs cover streaming, tools and error codes.
More guides
Questions and answers
Should I compare input price or output price?
Both, weighted by your own workload. Document-heavy jobs are dominated by input price, and writing-heavy jobs by output price.
How do I count tokens before I buy?
Run a sample of real prompts through a tokenizer, or send them to the API and read the usage block in the response. The usage numbers are what you are billed on.
Do failed requests cost money here?
No. Failed or refused requests are not charged on this service. Check the terms of any other provider you compare.
Is there a subscription?
No. It is pay as you go from prepaid credit, and the credit never expires.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.