Get Usage
curl --request GET \
--url https://api.limitguard.ai/v1/keys/usage \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.limitguard.ai/v1/keys/usage"
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.limitguard.ai/v1/keys/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.limitguard.ai/v1/keys/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 => [
"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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.limitguard.ai/v1/keys/usage"
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))
}HttpResponse<String> response = Unirest.get("https://api.limitguard.ai/v1/keys/usage")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitguard.ai/v1/keys/usage")
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{
"key_id": "<string>",
"tier": "<string>",
"monthly_usage": 123,
"monthly_limit": 123,
"remaining": 123,
"usage_percent": 123,
"balance_usd": 0
}API Reference
Get Usage
Check current API key usage, remaining quota and prepaid balance.
Send X-API-Key header to identify the key. Free endpoint (no x402 cost).
balance_usd is the prepaid balance each priced call is debited from (#434).
GET
/
v1
/
keys
/
usage
Get Usage
curl --request GET \
--url https://api.limitguard.ai/v1/keys/usage \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.limitguard.ai/v1/keys/usage"
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.limitguard.ai/v1/keys/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.limitguard.ai/v1/keys/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 => [
"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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.limitguard.ai/v1/keys/usage"
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))
}HttpResponse<String> response = Unirest.get("https://api.limitguard.ai/v1/keys/usage")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitguard.ai/v1/keys/usage")
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{
"key_id": "<string>",
"tier": "<string>",
"monthly_usage": 123,
"monthly_limit": 123,
"remaining": 123,
"usage_percent": 123,
"balance_usd": 0
}Authorizations
Response
200 - application/json
Successful Response
Response showing current API key usage, remaining quota and prepaid balance.
Key identifier (SHA-256 hash prefix)
Current pricing tier
Requests used this billing period
Monthly request ceiling for this tier (an abuse cap, not prepaid calls)
Requests remaining this period
Percentage of quota used (0-100)
Prepaid balance in USD; each priced call is debited at the price in the pricing table