Get Call Usage
curl --request GET \
--url https://api.60db.ai/agents/calls/{callId}/usage \
--header 'Authorization: <authorization>'import requests
url = "https://api.60db.ai/agents/calls/{callId}/usage"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.60db.ai/agents/calls/{callId}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.60db.ai/agents/calls/{callId}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.60db.ai/agents/calls/{callId}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.60db.ai/agents/calls/{callId}/usage")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.60db.ai/agents/calls/{callId}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"measured": true,
"total": {},
"services": [
{}
],
"turns": [
{}
],
"phone": {},
"price_usd": 123
}Agents
Get Call Usage
Credits a call used, by service and by turn, and its price
GET
/
agents
/
calls
/
{callId}
/
usage
Get Call Usage
curl --request GET \
--url https://api.60db.ai/agents/calls/{callId}/usage \
--header 'Authorization: <authorization>'import requests
url = "https://api.60db.ai/agents/calls/{callId}/usage"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.60db.ai/agents/calls/{callId}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.60db.ai/agents/calls/{callId}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.60db.ai/agents/calls/{callId}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.60db.ai/agents/calls/{callId}/usage")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.60db.ai/agents/calls/{callId}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"measured": true,
"total": {},
"services": [
{}
],
"turns": [
{}
],
"phone": {},
"price_usd": 123
}What one call cost: its credits by service and by turn, its phone minutes, and its price. Amounts are as charged: refunds are netted out, and a later rate change never moves a past call.
Request
Headers
Path
The call
id (UUID), from Place call or List callsResponse
200 OK{
"success": true,
"data": {
"call_id": "6f1c1e2a-1111-4222-8333-444455556666",
"measured": true,
"credits_per_usd": 50000,
"total": { "credits": 1450, "usd": 0.029 },
"services": [
{ "service": "stt", "credits": 250, "usd": 0.005, "units": 60 },
{ "service": "llm", "credits": 400, "usd": 0.008, "units": 16000 },
{ "service": "tts", "credits": 780, "usd": 0.0156, "units": 780 },
{ "service": "judge", "credits": 20, "usd": 0.0004, "units": 800 }
],
"turns": [
{ "turn": 1, "credits": 310, "usd": 0.0062, "services": { "stt": 50, "llm": 80, "tts": 180 } }
],
"phone": { "usd": 0.003, "seconds": 60 },
"price_usd": 0.032
}
}
Credits per service:
stt, tts, llm, judge, memory, runtime. units is the service’s own unit (seconds, characters, tokens, queries).Credits per turn of the call, in order. Speech-to-text counts toward the reply to what the caller said; text-to-speech toward the reply it voiced.
Line minutes on a 60db number, paid from the Dialer balance in USD.
null when the call used none (browser, stream and BYO-trunk calls).