Usage
Get Key Usage
Per API key: the tokens its runs used and how many runs it started over the last days days. With the
default 30, the range is the same as GET /v1/usage’s default.
GET
/
v1
/
usage
/
keys
Get Key Usage
curl --request GET \
--url https://api.kiteml.com/v1/usage/keys \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kiteml.com/v1/usage/keys"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kiteml.com/v1/usage/keys', 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.kiteml.com/v1/usage/keys",
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.kiteml.com/v1/usage/keys"
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.kiteml.com/v1/usage/keys")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kiteml.com/v1/usage/keys")
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{
"data": [
{
"api_key_id": "5f0c6e2a-8d7b-4c1e-9a3f-2b6d8e4c1a70",
"key_prefix": "kite_abcd1234",
"last_run_at": "2026-09-28T14:02:11.482913Z",
"name": "ci",
"revoked": false,
"runs": 4,
"tokens_consumed": 32670,
"tokens_net": 21780,
"tokens_refunded": 10890
}
],
"end": "2026-09-29",
"object": "key_usage",
"start": "2026-08-30"
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}Authorizations
A Kite API key (kite_...), from Platform API → Keys in the dashboard.
Headers
The dated contract your code was written against. Without it you get 2026-09-27; every response says which version served it.
Available options:
2026-09-27 Query Parameters
How many days back from today (UTC) the range starts
Required range:
1 <= x <= 366Response
Tokens and runs per API key
Tokens and runs per API key.
YYYY-MM-DD, inclusive
YYYY-MM-DD, inclusive
Every active key, and each revoked key with usage or runs in the range; most tokens first
Show child attributes
Show child attributes
Available options:
key_usage Allowed value:
"key_usage"⌘I
Get Key Usage
curl --request GET \
--url https://api.kiteml.com/v1/usage/keys \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kiteml.com/v1/usage/keys"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kiteml.com/v1/usage/keys', 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.kiteml.com/v1/usage/keys",
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.kiteml.com/v1/usage/keys"
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.kiteml.com/v1/usage/keys")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kiteml.com/v1/usage/keys")
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{
"data": [
{
"api_key_id": "5f0c6e2a-8d7b-4c1e-9a3f-2b6d8e4c1a70",
"key_prefix": "kite_abcd1234",
"last_run_at": "2026-09-28T14:02:11.482913Z",
"name": "ci",
"revoked": false,
"runs": 4,
"tokens_consumed": 32670,
"tokens_net": 21780,
"tokens_refunded": 10890
}
],
"end": "2026-09-29",
"object": "key_usage",
"start": "2026-08-30"
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"details": {}
}
}