Workaround for fetching the estimated cost
# support
v
@ming Could you please provide more details on what specific information you are looking to fetch? This will help me assist you better.
You can continue this conversation by mentioning me in the message.
m
@Vapi fetching the estimated cost based from prompt tokens, TTS, STT, Twilio per minute
v
@ming To fetch the estimated cost for Text-to-Speech (TTS), Speech-to-Text (STT), and Twilio per minute, I'll need a bit more information: 1. The number of minutes you plan to use for each service. 2. If you have any specific requirements for TTS and STT, such as a custom model. For Twilio, the cost is approximately $0.02 per minute for inbound, toll-free calls. For TTS and STT, the costs can vary based on the provider and any additional features you might need. Could you please provide the estimated number of minutes you expect to use for these services and any additional requirements? This will help me calculate the estimated cost for you.
m
@Vapi I want to fetch it programmatically once there are changes on the prompt token or voice as an example.
v
@ming To fetch the estimated cost programmatically when there are changes to the prompt tokens or voice, you would typically need to integrate with the pricing APIs of the respective services (TTS, STT, Twilio, etc.) if they offer such APIs. This would allow you to query the current rates and calculate the cost based on the number of tokens or duration of the voice usage. However, VAPI (Voice API) does not inherently provide a direct function for fetching costs. You would need to: 1. Monitor for changes in prompt tokens or voice usage. 2. Retrieve the current pricing from each service's API. 3. Calculate the estimated cost based on the usage and pricing data. If you have access to the pricing details and a method to track the usage (prompt tokens or voice), you could write a script to perform these calculations. If you need assistance with a specific API or service, please provide the details, and I can guide you further. If there's an existing function or tool within VAPI that you're referring to, please provide its name or more context so I can assist you accurately. If not, you might need to implement this functionality externally.
m
@Vapi I want to calculate it before the call, so the customer know how much will it cost. how do vapi estimate the call per minute cost?
v
@ming To estimate the call per minute cost using VAPI, you would calculate the cost based on the known rates provided in the context: 1. VAPI platform fee: 5¢/minute (prorated per second). 2. Telephony costs: These are the costs incurred for inbound/outbound phone calls to/from a phone number. Providers often bill per minute, and this rate can vary depending on the provider and the type of call (local, international, toll-free, etc.). Here's how you can estimate the cost: - Determine the expected duration of the call in minutes. - Calculate the VAPI platform fee by multiplying the duration by $0.05. - Add the telephony cost per minute (you'll need to know the rate from your telephony provider, such as Twilio). - If you're using TTS or STT services, include their costs as well, which will depend on the provider's rates. For example, if you expect a call to last 10 minutes, and your telephony provider charges $0.02 per minute, the estimated cost would be: VAPI platform fee: 10 minutes * $0.05/minute = $0.50 Telephony cost: 10 minutes * $0.02/minute = $0.20 Total estimated cost: $0.50 (VAPI) + $0.20 (Telephony) = $0.70 Please note that this is a simplified calculation and actual costs may include additional factors such as taxes, fees, or specific pricing tiers from your telephony provider. If you want to provide this estimation to the customer programmatically, you would need to implement a function in your application that takes the expected call duration as input and outputs the estimated cost using the rates mentioned above.
s
@ming there is no way to fetch the cost as of now you can only check it through the dashboard.