Get account usage
curl --request GET \
--url https://api.covalenthq.com/platform/usage/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/platform/usage/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.covalenthq.com/platform/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.covalenthq.com/platform/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: 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.covalenthq.com/platform/usage/"
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.covalenthq.com/platform/usage/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/platform/usage/")
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{
"period": {
"from": "<string>",
"to": "<string>"
},
"aggregate": {
"credits_consumed": 123,
"max_credits": 123,
"premium_credits": 123,
"free_credits": 123,
"plan": "<string>",
"flex_credits": {}
},
"by_day": [
{
"date": "<string>",
"premium_credits": 123,
"free_credits": 123
}
],
"by_api_key": [
{
"apikey": "<string>",
"credits": 123
}
]
}Service Keys
Get account usage
Read your GoldRush account usage programmatically — daily usage, aggregate credit consumption against your plan, and a per-API-key breakdown.
GET
/
platform
/
usage
/
Get account usage
curl --request GET \
--url https://api.covalenthq.com/platform/usage/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/platform/usage/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.covalenthq.com/platform/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.covalenthq.com/platform/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: 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.covalenthq.com/platform/usage/"
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.covalenthq.com/platform/usage/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/platform/usage/")
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{
"period": {
"from": "<string>",
"to": "<string>"
},
"aggregate": {
"credits_consumed": 123,
"max_credits": 123,
"premium_credits": 123,
"free_credits": 123,
"plan": "<string>",
"flex_credits": {}
},
"by_day": [
{
"date": "<string>",
"premium_credits": 123,
"free_credits": 123
}
],
"by_api_key": [
{
"apikey": "<string>",
"credits": 123
}
]
}Credential
ServiceKey (account-scoped)
Processing
Realtime
cqt_…). See Service Keys for how to create, use, and rotate one.
Platform endpoints on
api.covalenthq.com require a trailing slash — call /platform/usage/, not /platform/usage.Endpoint
GET https://api.covalenthq.com/platform/usage/
Authorization: Bearer <GOLDRUSH_SERVICE_KEY>
Request
Filter with either a rollingduration or an explicit from/to window. Every section of the response is computed over that single window (period).
integer
default:"1"
Rolling window in months, counting back from today. One of
1, 3, 6, or 12. The default 1 is month-to-date. Ignored when from/to are supplied.string
Start of an explicit window (
YYYY-MM-DD). Use together with to instead of duration.string
End of an explicit window (
YYYY-MM-DD). Use together with from instead of duration.Example
curl "https://api.covalenthq.com/platform/usage/?duration=1" \
-H "Authorization: Bearer $GOLDRUSH_SERVICE_KEY"
const response = await fetch(
"https://api.covalenthq.com/platform/usage/?duration=1",
{
headers: {
Authorization: `Bearer ${process.env.GOLDRUSH_SERVICE_KEY}`,
},
},
);
const body = await response.json();
import os, requests
response = requests.get(
"https://api.covalenthq.com/platform/usage/",
params={"duration": 1},
headers={"Authorization": f"Bearer {os.environ['GOLDRUSH_SERVICE_KEY']}"},
)
response.raise_for_status()
body = response.json()
goldrush usage --duration 1 --by-key
Response
The response is a{ "data": { … } } envelope containing the window it was computed over (period) and the three datasets.
{
"data": {
"period": {
"from": "2026-07-01",
"to": "2026-07-26"
},
"aggregate": {
"credits_consumed": 412000,
"max_credits": 1000000,
"premium_credits": 380000,
"free_credits": 32000,
"plan": "Advanced",
"flex_credits": {
"limit": 250000
}
},
"by_day": [
{
"date": "2026-07-25",
"premium_credits": 18400,
"free_credits": 1200
}
],
"by_api_key": [
{
"apikey": "cqt_rQ…",
"credits": 210000
}
]
}
}
Field descriptions
object
object
Aggregate credit consumption for the window.
object[]
object[]
Common uses
- Budget guardrails in code — watch
aggregate.credits_consumedagainstmax_credits(andflex_credits.limit) to alert or throttle before you hit the ceiling. - Per-key cost attribution — use
by_api_keyto split spend across projects, environments, or downstream customers for chargeback and show-back. - Usage trends — feed
by_day(premium vs. free) into your own BI or observability stack to forecast month-end spend and catch runaway jobs.
Common errors
| Status | Cause | Fix |
|---|---|---|
401 Unauthorized | Header missing or malformed, or the ServiceKey has been revoked. | Confirm Authorization: Bearer <key> and that the key is still active on the Platform. |
403 Forbidden | A regular API key was supplied instead of a ServiceKey. | Create a ServiceKey and retry. |