How to Compare AI API Pricing and Token Calculation Examples
Avoid pitfalls in AI API pricing comparison: understand unit prices, calculate monthly costs from tokens, and identify hidden costs with numbers.
Updated
Key Points
- Before comparing, determine the number of input and output tokens per 1 request
- Input and output have separate unit prices, so calculate the total using two multiplications
- Because conversation history is sent every time, the input increases per turn
- This API charges pay as you go: $0.15 for input and $0.50 for output (per 1 million tokens)

Decide usage, not just unit price
When comparing AI API pricing, the first thing people tend to list is the unit price: "how much per 1,000,000 tokens". However, even with the same unit price, the monthly cost can vary by many times depending on whether you send a large number of short prompts or make a model read a long document several times. Before comparing, define your usage with 3 numbers.
- Number of input tokens sent per 1 request (including system prompt and history)
- Number of output tokens returned per response
- Number of requests per month
Once these 3 are determined, you can calculate monthly costs using the same formula on any company's unit price table. Since other companies' prices change frequently, we don't list them here. Check the latest numbers on each company's official page.
Formula for monthly cost
Many APIs charge separate unit prices for input and output tokens. The formula is as follows:
Cost per request = (Input tokens ÷ 1,000,000 × Input unit price) + (Output tokens ÷ 1,000,000 × Output unit price)
Our unit prices are $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Let's calculate a typical interaction with 2,000 input tokens and 500 output tokens.
- Input: 2,000 ÷ 1,000,000 × $0.15 = $0.0003
- Output: 500 ÷ 1,000,000 × $0.50 = $0.00025
- Total: $0.00055
If you make 10,000 calls per month, it is $0.00055 × 10,000 = $5.50. Even with $0.50 of free trial credit, you can make about 909 trial calls with $0.50 ÷ $0.00055.
Example 1: Summarizing long documents
This use case has high input and low output. Let's calculate the cost of reading a 50,000-token document and receiving a 2,000-token summary.
| Item | Tokens | Calculation | Cost |
|---|---|---|---|
| Input | 50,000 | 50,000 ÷ 1,000,000 × $0.15 | $0.0075 |
| Output | 2,000 | 2,000 ÷ 1,000,000 × $0.50 | $0.001 |
| Total | $0.0085 |
Processing 1,000 documents costs $8.50. For this use case, the input price dominates, so the difference in output price matters little.
Example 2: Chat input increases when resending history
For chatbots and roleplay, you send the entire conversation history every time. As turns progress, the input grows. Set the conditions as follows:
- System prompt: 500 tokens
- User message: 100 tokens per turn
- Model response: 300 tokens per turn
- Conversation length: 30 turns
The input at turn k is 500 + 400 × (k − 1) + 100 = 600 + 400 × (k − 1) tokens. Add up the total for 30 turns.
- Total input: 30 × 600 + 400 × (0 + 1 + … + 29) = 18,000 + 400 × 435 = 192,000 tokens
- Total output: 30 × 300 = 9,000 tokens
- Input cost: 192,000 ÷ 1,000,000 × $0.15 = $0.0288
- Output cost: 9,000 ÷ 1,000,000 × $0.50 = $0.0045
- Total for 1 conversation: $0.0333
With a $20 charge, you get about 600 conversations ($20 ÷ $0.0333). Note that the total input is over 20 times the output. For chat use cases, the input price and history length matter more than the output price. Summarizing and shortening the history reduces costs.
Items to compare besides unit prices
Conditions not shown in the unit price table also affect the actual bill and usability. Before estimating, check the following points with each provider.
- Billing method: Is it a fixed monthly fee or pay-as-you-go? This API uses prepaid credit on a pay-as-you-go basis, has no subscriptions, and the credit never expires.
- Handling of failures: Are errors or rejected responses billed? This can cause a significant difference, similar to the $0.15 / $0.50 unit price difference. With this API, failed or rejected requests are not billed.
- Context length: If handling long documents, how many tokens fit in the prompt and output combined? This API supports 100,000 tokens.
- Rate limit: Concurrent requests and requests per minute. Full keys allow 8 concurrent and 300 per minute; trial keys allow 2 concurrent and 60 per minute.
- Content restrictions: Models with many rejections increase retries and raise effective costs.
- Compatibility: If OpenAI-compatible, code changes are almost unnecessary.
Calculating charges and bonuses
Charges are in integer amounts from $20 to $500, paid via USDT (TRC20) or USDC (Base). Bonuses based on the amount are as follows:
| Charge amount | Bonus | Credit granted |
|---|---|---|
| $20 | None | $20 |
| $50 | +5% | $52.50 |
| $100 | +10% | $110 |
| $200 | +15% | $230 |
For example 2, $110 in credit covers about 3,300 conversations ($110 ÷ $0.0333 ≈ 3,303). Check the pricing page for the latest terms, and see the documentation for billing and balance details. Get your free trial credit from the API key acquisition page and measure with your own usage for accuracy.
Measure and adjust the estimate
Estimates are theoretical. Actual responses include usage showing the number of tokens used. Run for a few days, take the average, and plug it into the formula above. Track your balance via GET /v1/balance or the response header X-Balance-USD.
Other guides
Frequently asked questions
What is the first thing to look for in a price comparison?
The number of input and output tokens per request, and the number of requests per month. Once these are determined, you can compare the input and output unit prices of each provider using the same formula.
How much is the API pricing?
It is pay as you go at $0.15 per 1 million input tokens and $0.50 for output. With prepaid credit, there are no subscriptions, and the credit never expires.
Is there a table comparing prices with other companies?
No. Prices from other companies change frequently, and we do not want to publish incorrect numbers. Check the latest prices on each provider's official page and plug them into the formulas in this article.
Are failed requests also billed?
No. Failed or rejected requests are not billed.
How are tokens counted?
Japanese tends to have more tokens per character than English. Check the exact number in the usage data included in the API response.
API keys are available with just one form
Create an account, copy the key, and change the base URL. That's all it takes to set up.