Account
Get usage
Review lifetime authenticated-request counts by API key.
GET
/
account
/
api-keys
/
usage
Get usage
curl --request GET \
--url https://api.darwin.so/api/v2/account/api-keys/usage \
--cookie __Secure-better-auth.session_token=import requests
url = "https://api.darwin.so/api/v2/account/api-keys/usage"
headers = {"cookie": "__Secure-better-auth.session_token="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: '__Secure-better-auth.session_token='}};
fetch('https://api.darwin.so/api/v2/account/api-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.darwin.so/api/v2/account/api-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_COOKIE => "__Secure-better-auth.session_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.darwin.so/api/v2/account/api-keys/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "__Secure-better-auth.session_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.darwin.so/api/v2/account/api-keys/usage")
.header("cookie", "__Secure-better-auth.session_token=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v2/account/api-keys/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = '__Secure-better-auth.session_token='
response = http.request(request)
puts response.read_body{
"usage": {
"period": "lifetime",
"requests": {
"total": 1
},
"apiKeys": {
"total": 1,
"active": 1,
"expired": 1,
"revoked": 1
},
"byKey": [
{
"id": "<string>",
"name": "<string>",
"prefix": "<string>",
"status": "active",
"requestCount": 1,
"lastUsedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": "<string>",
"message": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"fields": [
{}
]
}This endpoint reports operational API-key request counts. It does not report Action spend, wallet activity, or invoices.
Manage API keys in Darwin
Review your keys in Developer settings.
Authorizations
The HTTP-only Darwin account session cookie set after sign-in. Local development uses better-auth.session_token without the __Secure- prefix.
Response
Lifetime API-key request counts and key-status totals.
Show child attributes
Show child attributes
Last modified on September 21, 2026
⌘I
Get usage
curl --request GET \
--url https://api.darwin.so/api/v2/account/api-keys/usage \
--cookie __Secure-better-auth.session_token=import requests
url = "https://api.darwin.so/api/v2/account/api-keys/usage"
headers = {"cookie": "__Secure-better-auth.session_token="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: '__Secure-better-auth.session_token='}};
fetch('https://api.darwin.so/api/v2/account/api-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.darwin.so/api/v2/account/api-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_COOKIE => "__Secure-better-auth.session_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.darwin.so/api/v2/account/api-keys/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "__Secure-better-auth.session_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.darwin.so/api/v2/account/api-keys/usage")
.header("cookie", "__Secure-better-auth.session_token=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v2/account/api-keys/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = '__Secure-better-auth.session_token='
response = http.request(request)
puts response.read_body{
"usage": {
"period": "lifetime",
"requests": {
"total": 1
},
"apiKeys": {
"total": 1,
"active": 1,
"expired": 1,
"revoked": 1
},
"byKey": [
{
"id": "<string>",
"name": "<string>",
"prefix": "<string>",
"status": "active",
"requestCount": 1,
"lastUsedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": "<string>",
"message": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"fields": [
{}
]
}