Per-key usage rollup
curl --request GET \
--url https://api.kitefrost.ai/v1/keys/{key_prefix}/usageimport requests
url = "https://api.kitefrost.ai/v1/keys/{key_prefix}/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.kitefrost.ai/v1/keys/{key_prefix}/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.kitefrost.ai/v1/keys/{key_prefix}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.kitefrost.ai/v1/keys/{key_prefix}/usage"
req, _ := http.NewRequest("GET", url, nil)
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.kitefrost.ai/v1/keys/{key_prefix}/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/keys/{key_prefix}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"requests_24h": 0,
"requests_7d": 0,
"requests_30d": 0,
"requests_90d": 0,
"tokens_30d": 0,
"error_rate_30d": 0
}{
"error": "Forbidden",
"code": "forbidden",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Your API key does not have the required scope.",
"doc_url": "https://docs.kitefrost.ai/errors/forbidden"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Rate limit exceeded",
"code": "rate_limited",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "You have exceeded the rate limit for your plan.",
"doc_url": "https://docs.kitefrost.ai/errors/rate_limited"
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}keys
Per-key usage rollup
Rolled-up request / token / error counts for a specific API key. Aggregated nightly from runtime_events into key_usage_daily (migration 043). A freshly minted key legitimately has no rollup rows yet - the endpoint returns zeros in that case rather than 404.
GET
/
v1
/
keys
/
{key_prefix}
/
usage
Per-key usage rollup
curl --request GET \
--url https://api.kitefrost.ai/v1/keys/{key_prefix}/usageimport requests
url = "https://api.kitefrost.ai/v1/keys/{key_prefix}/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.kitefrost.ai/v1/keys/{key_prefix}/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.kitefrost.ai/v1/keys/{key_prefix}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.kitefrost.ai/v1/keys/{key_prefix}/usage"
req, _ := http.NewRequest("GET", url, nil)
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.kitefrost.ai/v1/keys/{key_prefix}/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/keys/{key_prefix}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"requests_24h": 0,
"requests_7d": 0,
"requests_30d": 0,
"requests_90d": 0,
"tokens_30d": 0,
"error_rate_30d": 0
}{
"error": "Forbidden",
"code": "forbidden",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Your API key does not have the required scope.",
"doc_url": "https://docs.kitefrost.ai/errors/forbidden"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Rate limit exceeded",
"code": "rate_limited",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "You have exceeded the rate limit for your plan.",
"doc_url": "https://docs.kitefrost.ai/errors/rate_limited"
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}Path Parameters
Response
Usage rollup (zeros when no rows yet)
GET /v1/keys/{key_prefix}/usage - rolled-up per-key counters.
Values are aggregated nightly from runtime_events into the key_usage_daily table (migration 043). Returns zeros for any window that has no rolled-up data yet - a brand-new key legitimately has zero requests, and returning 404 would force the dashboard into a special-case render path.