curl --request GET \
--url https://cloud-api.near.ai/v1/admin/platform/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/platform/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud-api.near.ai/v1/admin/platform/metrics', 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://cloud-api.near.ai/v1/admin/platform/metrics",
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://cloud-api.near.ai/v1/admin/platform/metrics"
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://cloud-api.near.ai/v1/admin/platform/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/platform/metrics")
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{
"active_organizations": 123,
"generated_at": "2023-11-07T05:31:56Z",
"new_organizations": 123,
"new_users": 123,
"non_verifiable_consumed_usd": 123,
"non_verifiable_requests": 123,
"paying_organizations": 123,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"provider_error_or_timeout_rate": 123,
"provider_usage": {
"by_provider_tier": [
{
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123,
"provider_tier": "<string>"
}
],
"by_provider_type": [
{
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123,
"provider_type": "<string>"
}
],
"fallback": {
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123
},
"non_fallback": {
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123
}
},
"top_models": [
{
"model_name": "<string>",
"requests": 123,
"revenue_usd": 123
}
],
"top_organizations": [
{
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_name": "<string>",
"requests": 123,
"spend_usd": 123
}
],
"total_cache_read_tokens": 123,
"total_consumed_usd": 123,
"total_organizations": 123,
"total_requests": 123,
"total_tokens": 123,
"total_users": 123,
"verifiable_consumed_usd": 123,
"verifiable_requests": 123,
"p95_ttft_ms": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Get platform-wide metrics for admin dashboards (Admin only)
Returns aggregated metrics across all organizations including:
- Total users and organizations
- Total requests and revenue
- Top models by usage
- Top organizations by spend
curl --request GET \
--url https://cloud-api.near.ai/v1/admin/platform/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/platform/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud-api.near.ai/v1/admin/platform/metrics', 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://cloud-api.near.ai/v1/admin/platform/metrics",
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://cloud-api.near.ai/v1/admin/platform/metrics"
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://cloud-api.near.ai/v1/admin/platform/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/platform/metrics")
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{
"active_organizations": 123,
"generated_at": "2023-11-07T05:31:56Z",
"new_organizations": 123,
"new_users": 123,
"non_verifiable_consumed_usd": 123,
"non_verifiable_requests": 123,
"paying_organizations": 123,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"provider_error_or_timeout_rate": 123,
"provider_usage": {
"by_provider_tier": [
{
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123,
"provider_tier": "<string>"
}
],
"by_provider_type": [
{
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123,
"provider_type": "<string>"
}
],
"fallback": {
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123
},
"non_fallback": {
"cache_read_tokens": 123,
"consumed_cost_usd": 123,
"input_tokens": 123,
"output_tokens": 123,
"requests": 123,
"total_tokens": 123
}
},
"top_models": [
{
"model_name": "<string>",
"requests": 123,
"revenue_usd": 123
}
],
"top_organizations": [
{
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_name": "<string>",
"requests": 123,
"spend_usd": 123
}
],
"total_cache_read_tokens": 123,
"total_consumed_usd": 123,
"total_organizations": 123,
"total_requests": 123,
"total_tokens": 123,
"total_users": 123,
"verifiable_consumed_usd": 123,
"verifiable_requests": 123,
"p95_ttft_ms": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
JWT access token for user authentication (Authorization: Bearer <jwt_token>). Create via POST /users/me/access_tokens.
Query Parameters
Start of time range (ISO 8601). Defaults to 30 days ago.
End of time range (ISO 8601). Defaults to now.
Response
Platform metrics retrieved successfully
Platform-wide metrics for admin dashboard
Organizations that issued ≥1 request in the period
When this response was computed. The total_users/total_organizations/
paying_organizations fields are current snapshots as of this time, not
period-bound like the rest.
Organizations created in the period
Users created in the period
Consumed cost on non-verifiable models, USD (NOT necessarily third-party)
Snapshot (as of generated_at): orgs with an active payment-type credit.
NOTE: does not yet count postpaid/invoiced customers (see #704).
Share of requests whose stop_reason ∈ {provider_error, timeout}, 0.0–1.0
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Total consumed usage cost in USD over the period (inference only). NOT recognized revenue: grant/payment funding is not separable without per-request attribution (tracked in #704).
Snapshot (as of generated_at).
Snapshot (as of generated_at).
Consumed cost on verifiable (TEE-attested) models, USD
95th percentile time-to-first-token across the platform (ms)