Skip to main content
GET
/
mcp-hub
/
usage
Get MCP Hub API Usage Summary
curl --request GET \
  --url https://api.enkryptai.com/mcp-hub/usage \
  --header 'apikey: <api-key>'
import requests

url = "https://api.enkryptai.com/mcp-hub/usage"

headers = {"apikey": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {apikey: '<api-key>'}};

fetch('https://api.enkryptai.com/mcp-hub/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.enkryptai.com/mcp-hub/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 => [
"apikey: <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.enkryptai.com/mcp-hub/usage"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("apikey", "<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.enkryptai.com/mcp-hub/usage")
.header("apikey", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.enkryptai.com/mcp-hub/usage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "window": {
    "start": "2023-11-07T05:31:56Z",
    "end": "2023-11-07T05:31:56Z",
    "label": "30d"
  },
  "total_calls": 12345,
  "successful_calls": 12000,
  "by_endpoint": [
    {
      "endpoint": "scans_list",
      "calls": 5000,
      "successful": 4900
    }
  ],
  "top_endpoints": [
    {
      "endpoint": "scans_list",
      "calls": 5000,
      "successful": 4900
    }
  ],
  "by_project": [
    {
      "project_name": "default",
      "calls": 3200
    }
  ],
  "by_status_class": [
    {
      "status_class": 200,
      "calls": 12000
    }
  ],
  "by_day": [
    {
      "day": "2026-06-20",
      "calls": 420,
      "successful": 410
    }
  ],
  "generated_at": "2023-11-07T05:31:56Z"
}
{
"detail": "<string>"
}
{
"code": 403,
"error": "Forbidden",
"message": "MCP Hub APIs are an enterprise feature not enabled for your organization. Contact us at support@enkryptai.com for access.",
"request_id": "<string>",
"time": 123
}
{
"detail": "<string>"
}

Authorizations

apikey
string
header
required

Query Parameters

period
enum<string>
default:30d

Relative window ending now. One of 24h, 7d, 30d, 90d. Ignored when start/end are supplied. Defaults to 30d.

Available options:
24h,
7d,
30d,
90d
start
string<date-time>

Start of a custom window (RFC3339). When set, overrides period. The window is capped at 90 days.

end
string<date-time>

End of a custom window (RFC3339). Defaults to now. The window is capped at 90 days.

Response

Aggregate usage summary for the organization

Aggregate-only usage summary for the calling organization. No raw call records are returned.

org_id
string<uuid>
window
MCPHubUsageWindow · object

The resolved time window the summary covers.

total_calls
integer
Example:

12345

successful_calls
integer

Calls that returned a 2xx status.

Example:

12000

by_endpoint
MCPHubUsageEndpointStat · object[]

Per-endpoint call counts, ordered by calls descending.

top_endpoints
MCPHubUsageEndpointStat · object[]

The five most-called endpoints (a subset of by_endpoint).

by_project
MCPHubUsageProjectStat · object[]

Per-project call counts, ordered by calls descending.

by_status_class
MCPHubUsageStatusStat · object[]

Call counts grouped by HTTP status class.

by_day
MCPHubUsageDayStat · object[]

Daily call counts across the window (UTC), ordered by day ascending.

generated_at
string<date-time>