Tool Execution Stats
curl --request GET \
--url https://api.bland.ai/v2/tools/logs/stats \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/tools/logs/stats"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/tools/logs/stats', 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.bland.ai/v2/tools/logs/stats",
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.bland.ai/v2/tools/logs/stats"
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.bland.ai/v2/tools/logs/stats")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/tools/logs/stats")
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_bodyGET /v2/tools/logs/stats?group_by=integration,status&metrics=count,execution_time_ms:avg&period=week
{
"results": [
{
"integration": "slack",
"status": "success",
"count": 142,
"execution_time_ms_avg": 318.5
},
{
"integration": "slack",
"status": "error",
"count": 3,
"execution_time_ms_avg": 10000.0
}
],
"meta": {
"group_by": ["integration", "status"],
"metrics": ["count", "execution_time_ms:avg"],
"period": "week"
}
}
Logs & Analytics
Tool Execution Stats
Retrieve aggregated execution statistics for your tools, grouped and filtered by integration, status, date, and more. Maximum date range is 90 days.
GET
/
v2
/
tools
/
logs
/
stats
Tool Execution Stats
curl --request GET \
--url https://api.bland.ai/v2/tools/logs/stats \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/tools/logs/stats"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/tools/logs/stats', 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.bland.ai/v2/tools/logs/stats",
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.bland.ai/v2/tools/logs/stats"
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.bland.ai/v2/tools/logs/stats")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/tools/logs/stats")
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_bodyGET /v2/tools/logs/stats?group_by=integration,status&metrics=count,execution_time_ms:avg&period=week
{
"results": [
{
"integration": "slack",
"status": "success",
"count": 142,
"execution_time_ms_avg": 318.5
},
{
"integration": "slack",
"status": "error",
"count": 3,
"execution_time_ms_avg": 10000.0
}
],
"meta": {
"group_by": ["integration", "status"],
"metrics": ["count", "execution_time_ms:avg"],
"period": "week"
}
}
Headers
string
required
Your API key for authentication.
Query Parameters
Groupingstring
Comma-separated list of fields to group results by. Supported values:
integration, action, status, tool_id, resource_id, error_type, date.Example: group_by=integration,statusstring
Comma-separated list of metrics to compute. Use
"count" for total execution count, or "field:avg" for averages.Supported aggregate fields: execution_time_ms, input_size_kb, output_size_kb.Defaults to "count".Example: metrics=count,execution_time_ms:avgstring
Preset time period. Allowed values:
"today", "week", "month". Overridden by start_date/end_date if both are provided.string
Start of the date range (ISO 8601). Maximum range is 90 days from
end_date.string
End of the date range (ISO 8601). Maximum range is 90 days from
start_date.string
Filter stats to a specific tool ID.
string
Filter stats to a specific resource ID.
string
Filter by integration key.
string
Filter by action name.
string
Filter by execution status. Allowed values:
"success", "error".string
Filter by error type.
string
Filter to a specific call ID.
number
Maximum number of groups to return. Minimum
1, maximum 1000. Defaults to 50.Response
array
Array of aggregated result objects. Each entry contains the grouped dimensions and the requested metric values.
Show result entry
Show result entry
string
Integration key (present when grouped by
integration).string
Action name (present when grouped by
action).string
Execution status (present when grouped by
status).string
Tool ID (present when grouped by
tool_id).string
Date string (present when grouped by
date).number
Total execution count (present when
count is in metrics).number
Average execution time in ms (present when
execution_time_ms:avg is in metrics).number
Average input size in KB (present when
input_size_kb:avg is in metrics).number
Average output size in KB (present when
output_size_kb:avg is in metrics).object
Metadata about the query that was executed.
GET /v2/tools/logs/stats?group_by=integration,status&metrics=count,execution_time_ms:avg&period=week
{
"results": [
{
"integration": "slack",
"status": "success",
"count": 142,
"execution_time_ms_avg": 318.5
},
{
"integration": "slack",
"status": "error",
"count": 3,
"execution_time_ms_avg": 10000.0
}
],
"meta": {
"group_by": ["integration", "status"],
"metrics": ["count", "execution_time_ms:avg"],
"period": "week"
}
}
Docs for agents: llms.txt
Was this page helpful?