Calculation Methodology

AI API costs are calculated based on the number of tokens processed. Most providers charge different rates for input (prompts) and output (completions) tokens. Input tokens are generally cheaper because they require less computational effort to process compared to generating new text.

The total cost is calculated using the following formula:

$$Cost = \left( \frac{\text{Input Tokens}}{1,000,000} \times \text{Input Price} \right) + \left( \frac{\text{Output Tokens}}{1,000,000} \times \text{Output Price} \right)$$

  • **Input Price**: Cost per 1M input tokens (prompt).
  • **Output Price**: Cost per 1M output tokens (generation).

Monthly prediction is calculated by multiplying the cost of a single request by the total number of requests per month.