Billing
Get a usage summary
Aggregated spend and top-ups for a date range, broken down by transaction type. Both dates are required.
credits_used is returned as a positive number even though the underlying rows are negative.
GET
/
billing
/
usage-summary
Get a usage summary
curl --request GET \
--url https://api.vocobase.com/api/v2/billing/usage-summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vocobase.com/api/v2/billing/usage-summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vocobase.com/api/v2/billing/usage-summary', 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.vocobase.com/api/v2/billing/usage-summary",
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: Bearer <token>"
],
]);
$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.vocobase.com/api/v2/billing/usage-summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.vocobase.com/api/v2/billing/usage-summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/billing/usage-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"period": {
"start": "2026-08-01T00:00:00.000Z",
"end": "2026-08-31T23:59:59.000Z"
},
"summary": {
"usage": {
"count": 1842,
"total": -10614.4
},
"purchase": {
"count": 2,
"total": 50000
}
},
"totals": {
"transaction_count": 1844,
"credits_added": 50000,
"credits_used": 10614.4,
"net_change": 39385.6
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "start_date and end_date are required"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}Authorizations
API key in format: rg_live_xxxx. Pass as a Bearer token in the Authorization header.
Query Parameters
Start of the range, ISO 8601.
End of the range, ISO 8601.
⌘I
Get a usage summary
curl --request GET \
--url https://api.vocobase.com/api/v2/billing/usage-summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vocobase.com/api/v2/billing/usage-summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vocobase.com/api/v2/billing/usage-summary', 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.vocobase.com/api/v2/billing/usage-summary",
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: Bearer <token>"
],
]);
$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.vocobase.com/api/v2/billing/usage-summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.vocobase.com/api/v2/billing/usage-summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/billing/usage-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"period": {
"start": "2026-08-01T00:00:00.000Z",
"end": "2026-08-31T23:59:59.000Z"
},
"summary": {
"usage": {
"count": 1842,
"total": -10614.4
},
"purchase": {
"count": 2,
"total": 50000
}
},
"totals": {
"transaction_count": 1844,
"credits_added": 50000,
"credits_used": 10614.4,
"net_change": 39385.6
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "start_date and end_date are required"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}