Vapi + openAI pricing calculation inconsistency.
# support
f
Hi, I have an inconsistency in calculating the price that I would like help with: Example from practice: On 19.11 I had 2 calls via VAPI, which lasted a total of 20 minutes. In VAPI I see the price of one 10 min call 55 cents and the second 10 min call 52 cents, which is approximately right. (0.05 € per minute). I want to calculate the exact price I paid for a 10 min call to OpenAI. In VAPI, for one of those 10 minute calls, I see written that the price for LLM: $0.00 ($0.00 / min) ‣ 104069prompt tokens ‣ 2325completion tokens I use the gpt 4o model, where the price is $2.50 / 1M input tokens and $10.00 / 1M output tokens. Calculation: We have: • 104,069 prompt tokens • 2,325 completion tokens • Prices: • $2.50 / 1M prompt tokens • $10.00 / 1M completion tokens The total price for these tokens is $0.28 for the first 10 min call. The second 10 min call, using the same calculation method, comes out to be a price for 10 min. call: $0.35. So both calls together are: $0.63. I understand that each call can have a different price, but what I don't understand is why in openAI, it shows me on that day (19.11) that VAPI and gpt 4o spent $1.01, when according to the tokens that VAPI shows, it should be $0.63. In this case it is a negligible difference, but I am trying to understand how to calculate it as accurately as possible to avoid inaccuracies in case of larger scaling, or when I call hundreds of hours per month. How do you calculate it? Is there a simple calculator for this? How to calculate the price of e.g. 10 minutes of calls via VAPI and openAI for the given model. Thank you very much. https://cdn.discordapp.com/attachments/1313081346947547146/1313081347530821642/Snimka_obrazovky_2024-12-02_o_10.54.01.png?ex=674ed5cd&is=674d844d&hm=4a3776b4c20e70c3aca2a70d2c45169141e40558525dabac79a0d7495419c9f3& https://cdn.discordapp.com/attachments/1313081346947547146/1313081348025614428/Snimka_obrazovky_2024-12-02_o_10.53.33.png?ex=674ed5cd&is=674d844d&hm=c118c05608621b44113320f913d440170feba35844fc295b069365ad008830bc&
v
@Fanfantulipan Hello! I'm glad to assist you with the pricing calculation for your calls using VAPI and OpenAI's GPT-4 model. Based on the information you've provided, let's break down the calculation for the cost of LLM (Large Language Model) usage for a 10-minute call: For the first 10-minute call: - Prompt tokens: 104,069 - Completion tokens: 2,325 - Cost per 1M prompt tokens: $2.50 - Cost per 1M completion tokens: $10.00 The cost for prompt tokens is calculated as follows: 104,069 tokens / 1,000,000 tokens * $2.50 = $0.2601725 The cost for completion tokens is calculated as follows: 2,325 tokens / 1,000,000 tokens * $10.00 = $0.02325 Adding both costs together gives us: $0.2601725 + $0.02325 = $0.2834225 (rounded to $0.28) For the second 10-minute call, you would perform the same calculation with the respective number of tokens used in that call. Now, regarding the discrepancy you've noticed, there could be several reasons for this, including but not limited to: - Rounding differences in the billing system. - Additional hidden costs or fees that may not be immediately apparent. - A delay in the reporting system that might not have updated the usage in real-time. Unfortunately, I don't have access to the exact billing details or a simple calculator tool that can be used for this purpose. However, the calculation method you've used seems correct, and for a more detailed breakdown or to address the discrepancy, I would recommend reaching out to OpenAI's support with the specifics of your billing query. If you need further assistance or have any other questions, feel free to ask. If your query is resolved, please let me know, and I can close this support ticket for you.
You can continue this conversation by mentioning me in the message.
f
Hi, Thank you for your response. While I understand the general calculations and the possible causes of discrepancies you mentioned, I’d like to dig deeper into this issue to ensure I can scale my usage accurately without unexpected costs. Specifically, I would like to: 1. Understand if there are any additional costs, fees, or adjustments (e.g., minimum charges or rounding rules) that OpenAI applies to token usage beyond what is shown in the pricing for the GPT-4o model. 2. Confirm whether the difference in my billing ($0.63 vs $1.01) is due to rounding or other factors in OpenAI’s billing system. 3. Learn if there’s a way to automate or directly access more detailed token-level billing data through the OpenAI API or dashboard to cross-check usage. Additionally, I would appreciate it if this ticket could be escalated to a human representative who can provide further clarification. I want to ensure I have a clear understanding of all variables to prevent discrepancies, especially as I plan to scale to potentially hundreds of hours per month. Please let me know if I need to provide more details or clarify my use case further. Looking forward to your response.
s
@Fanfantulipan can you share all of the call ids for which you want the cost breakdown.
5 Views