Credit Consumption Totals
curl --request GET \
--url https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/ \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/")
.header("X-API-KEY", "<api-key>")
.asString();{
"total_credits_spent": "<string>"
}{
"detail": "Authentication credentials were not provided."
}Credit Consumption Totals
Get the total credits spent over a specified timeframe.
GET
https://api-v2.forager.ai
/
api
/
{account_id}
/
subscriptions
/
balance_change_logs
/
totals
/
Credit Consumption Totals
curl --request GET \
--url https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/ \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/")
.header("X-API-KEY", "<api-key>")
.asString();{
"total_credits_spent": "<string>"
}{
"detail": "Authentication credentials were not provided."
}When to use this endpoint
You want one number: the credits spent in a period. Send the same date filters as the change log.Example request
cURL
curl -G "https://api-v2.forager.ai/api/$FORAGER_ACCOUNT_ID/subscriptions/balance_change_logs/totals/" \
-H "X-API-KEY: $FORAGER_API_KEY" \
--data-urlencode "date_created_start=2026-10-01T00:00:00Z" \
--data-urlencode "date_created_end=2026-11-01T00:00:00Z"
FORAGER_API_KEY and FORAGER_ACCOUNT_ID as in the quickstart.
Example response
200 (illustrative values)
{
"total_credits_spent": "245.00"
}
Credits
The credit cost of this operation is not documented yet. See API credits and pricing.Authorizations
Path Parameters
Response
Declares JSON representation of CreditsBalanceChangeLogsView.total_credits_spent() action response.
Pattern:
^-?\d{0,10}(?:\.\d{0,2})?$Last modified on November 1, 2026