Get the per-model consumption ranking (Admin only)
curl --request GET \
--url https://cloud-api.near.ai/v1/admin/platform/model-revenue \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/platform/model-revenue"
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/model-revenue', 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/model-revenue",
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/model-revenue"
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/model-revenue")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/platform/model-revenue")
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": [
{
"consumed_cost_usd": 123,
"fallback_consumed_cost_usd": 123,
"fallback_requests": 123,
"model_name": "<string>",
"requests": 123,
"served_provider_breakdown": [
{
"consumed_cost_usd": 123,
"requests": 123,
"served_via_fallback": true,
"tokens": 123,
"provider_tier": "<string>",
"provider_type": "<string>"
}
],
"tokens": 123,
"unique_orgs": 123,
"verifiable": true,
"avg_ttft_ms": 123,
"p95_ttft_ms": 123,
"provider_type": "<string>"
}
],
"limit": 123,
"offset": 123,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"total": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Admin
Get the per-model consumption ranking (Admin only)
deprecated
Deprecated: this endpoint is moving to cloud-platform at the same path; the cloud-platform base URL will be announced. Behaviour may differ in edge cases.
Models for the selected period ranked by consumed cost, with requests, tokens, unique orgs, verifiable flag, provider type, and latency. Paginated and filterable.
Percentiles across hours are approximate (sample-weighted means of hourly percentiles).
Admin permissions: admin session, read_write token, or read_only token. Approved read across organizations; does not mutate business state.
GET
/
v1
/
admin
/
platform
/
model-revenue
Get the per-model consumption ranking (Admin only)
curl --request GET \
--url https://cloud-api.near.ai/v1/admin/platform/model-revenue \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/platform/model-revenue"
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/model-revenue', 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/model-revenue",
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/model-revenue"
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/model-revenue")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/platform/model-revenue")
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": [
{
"consumed_cost_usd": 123,
"fallback_consumed_cost_usd": 123,
"fallback_requests": 123,
"model_name": "<string>",
"requests": 123,
"served_provider_breakdown": [
{
"consumed_cost_usd": 123,
"requests": 123,
"served_via_fallback": true,
"tokens": 123,
"provider_tier": "<string>",
"provider_type": "<string>"
}
],
"tokens": 123,
"unique_orgs": 123,
"verifiable": true,
"avg_ttft_ms": 123,
"p95_ttft_ms": 123,
"provider_type": "<string>"
}
],
"limit": 123,
"offset": 123,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"total": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
session_tokenadmin_token
Query Parameters
Response
Model revenue retrieved successfully