bumpy-apartment-5598
02/16/2025, 8:01 PMgray-monkey-83525
02/16/2025, 8:01 PMroomList
grant and is available to LiveKit Cloud customers with a Scale plan or higher.
For pricing details, LiveKit's billing is based on resources consumed, such as outbound transfer and connection minutes, as detailed in the Billing documentation. If you need more specific information on tracking consumption or pricing, please let me know.
Sources:
- Analytics API
- Billing 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.bumpy-apartment-5598
02/16/2025, 8:02 PMgray-monkey-83525
02/16/2025, 8:02 PMasync function calculatePricing(projectId, token) {
const endpoint = `https://cloud-api.livekit.io/api/project/${projectId}/sessions/`;
try {
const response = await fetch(endpoint, {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
});
if (!response.ok) throw new Error('Network response was not ok');
const data = await response.json();
let totalCost = 0;
data.sessions.forEach(session => {
const bandwidthCost = (session.bandwidthIn + session.bandwidthOut) * 0.01; // Example rate
const connectionCost = session.numParticipants * session.duration * 0.02; // Example rate
totalCost += bandwidthCost + connectionCost;
});
console.log(`Total estimated cost: $${totalCost.toFixed(2)}`);
} catch (error) {
console.log('There was a problem:', error.message);
}
}
calculatePricing('your_project_id', 'your_access_token');
This function fetches session data and calculates a hypothetical cost based on example rates. You would need to replace these rates with actual values from your billing agreement. Would you like more details on this?
Sources:
- Billing documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.