TypeScript (SDK)
import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.observability.getBillingStats({
body: {},
});
console.log(result);
}
run();import os
from textql_sdk import Textql
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.observability.get_billing_stats()
# Handle response
print(res)curl --request POST \
--url https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '{
"days": 123
}'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({days: 123})
};
fetch('https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats', 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://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'days' => 123
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats"
payload := strings.NewReader("{\n \"days\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"days\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"days\": 123\n}"
response = http.request(request)
puts response.read_body{
"memberStats": [
{
"memberId": "<string>",
"memberName": "<string>",
"email": "<string>",
"totalAcu": 123,
"acuByCategory": {},
"acuBySource": {},
"profileImageUrl": "<string>",
"threadCount": 123,
"playbookCount": 123,
"dashboardCount": 123,
"agentCount": 123,
"isFormerMember": true,
"positiveSignalCount": 123,
"negativeSignalCount": 123,
"flaggedThreadCount": 123,
"analyzedThreadCount": 123
}
],
"agentStats": [
{
"agentId": "<string>",
"estimatedAcu": 123
}
],
"totalFeedAcu": 123,
"playbookStats": [
{
"playbookId": "<string>",
"playbookName": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"totalAcu": 123,
"llmAcu": 123,
"computeAcu": 123,
"runCount": 123,
"dailyRunCounts": [
123
],
"isActive": true
}
],
"dashboardStats": [
{
"dashboardId": "<string>",
"dashboardName": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"computeAcu": 123,
"refreshCount": 123,
"viewCount": 123,
"lastViewedAt": "2023-11-07T05:31:56Z",
"dailyViewCounts": [
123
],
"isPublished": true
}
],
"totalPlaybookAcu": 123,
"totalDashboardAcu": 123,
"unattributedFeedAcu": 123,
"unattributedDashboardAcu": 123,
"totalDashboardCount": 123,
"totalPlaybookCount": 123,
"unattributedPlaybookAcu": 123,
"appStats": [
{
"appId": "<string>",
"appName": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"computeAcu": 123,
"refreshCount": 123,
"viewCount": 123,
"lastViewedAt": "2023-11-07T05:31:56Z",
"dailyViewCounts": [
123
],
"isPublished": true
}
],
"totalAppAcu": 123,
"unattributedAppAcu": 123,
"totalAppCount": 123,
"acuRatePer1000Usd": 123
}{
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Observability Service
Get Billing Stats
POST
/
textql.rpc.public.observe.ObservabilityService
/
GetBillingStats
TypeScript (SDK)
import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.observability.getBillingStats({
body: {},
});
console.log(result);
}
run();import os
from textql_sdk import Textql
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.observability.get_billing_stats()
# Handle response
print(res)curl --request POST \
--url https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '{
"days": 123
}'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({days: 123})
};
fetch('https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats', 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://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'days' => 123
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats"
payload := strings.NewReader("{\n \"days\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"days\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/textql.rpc.public.observe.ObservabilityService/GetBillingStats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"days\": 123\n}"
response = http.request(request)
puts response.read_body{
"memberStats": [
{
"memberId": "<string>",
"memberName": "<string>",
"email": "<string>",
"totalAcu": 123,
"acuByCategory": {},
"acuBySource": {},
"profileImageUrl": "<string>",
"threadCount": 123,
"playbookCount": 123,
"dashboardCount": 123,
"agentCount": 123,
"isFormerMember": true,
"positiveSignalCount": 123,
"negativeSignalCount": 123,
"flaggedThreadCount": 123,
"analyzedThreadCount": 123
}
],
"agentStats": [
{
"agentId": "<string>",
"estimatedAcu": 123
}
],
"totalFeedAcu": 123,
"playbookStats": [
{
"playbookId": "<string>",
"playbookName": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"totalAcu": 123,
"llmAcu": 123,
"computeAcu": 123,
"runCount": 123,
"dailyRunCounts": [
123
],
"isActive": true
}
],
"dashboardStats": [
{
"dashboardId": "<string>",
"dashboardName": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"computeAcu": 123,
"refreshCount": 123,
"viewCount": 123,
"lastViewedAt": "2023-11-07T05:31:56Z",
"dailyViewCounts": [
123
],
"isPublished": true
}
],
"totalPlaybookAcu": 123,
"totalDashboardAcu": 123,
"unattributedFeedAcu": 123,
"unattributedDashboardAcu": 123,
"totalDashboardCount": 123,
"totalPlaybookCount": 123,
"unattributedPlaybookAcu": 123,
"appStats": [
{
"appId": "<string>",
"appName": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"computeAcu": 123,
"refreshCount": 123,
"viewCount": 123,
"lastViewedAt": "2023-11-07T05:31:56Z",
"dailyViewCounts": [
123
],
"isPublished": true
}
],
"totalAppAcu": 123,
"unattributedAppAcu": 123,
"totalAppCount": 123,
"acuRatePer1000Usd": 123
}{
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Authorizations
Headers
Define the version of the Connect protocol
Available options:
1 Define the timeout, in ms
Body
application/json
Response
Success
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Effective ACU->USD rate for this org, in USD per 1000 ACUs (resolved from the tenant's pricing tier / active override). Multiply any ACU figure by (rate / 1000) to show dollars. 0 means unknown/unpriced (e.g. trial).
⌘I