Per-person, per-model consumption for the org
curl --request GET \
--url https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person', 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.mnemom.ai/v1/orgs/{org_id}/usage/by-person",
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.mnemom.ai/v1/orgs/{org_id}/usage/by-person"
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.mnemom.ai/v1/orgs/{org_id}/usage/by-person")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person")
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{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"collection_started_at": "2023-11-07T05:31:56Z",
"data": [
{
"user_id": "<string>",
"display_name": "<string>",
"email": "<string>",
"membership_state": "active",
"provider": "<string>",
"model": "<string>",
"tokens_in": "<string>",
"tokens_out": "<string>",
"request_count": "<string>"
}
],
"totals": {
"tokens_in": "<string>",
"tokens_out": "<string>",
"request_count": "<string>",
"attributed_request_count": "<string>",
"unattributed_request_count": "<string>",
"attribution_rate": 0.5
},
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Organizations
Per-person, per-model consumption for the org
Query-time aggregation of token/request consumption grouped by attributed person, provider, and model, scoped ONLY to the org’s own usage_events via the immu…
GET
/
orgs
/
{org_id}
/
usage
/
by-person
Per-person, per-model consumption for the org
curl --request GET \
--url https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person', 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.mnemom.ai/v1/orgs/{org_id}/usage/by-person",
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.mnemom.ai/v1/orgs/{org_id}/usage/by-person"
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.mnemom.ai/v1/orgs/{org_id}/usage/by-person")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mnemom.ai/v1/orgs/{org_id}/usage/by-person")
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{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"collection_started_at": "2023-11-07T05:31:56Z",
"data": [
{
"user_id": "<string>",
"display_name": "<string>",
"email": "<string>",
"membership_state": "active",
"provider": "<string>",
"model": "<string>",
"tokens_in": "<string>",
"tokens_out": "<string>",
"request_count": "<string>"
}
],
"totals": {
"tokens_in": "<string>",
"tokens_out": "<string>",
"request_count": "<string>",
"attributed_request_count": "<string>",
"unattributed_request_count": "<string>",
"attribution_rate": 0.5
},
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Supabase JWT token in Authorization: Bearer header
Path Parameters
Organization identifier (e.g. org-abc12345)
Query Parameters
Available options:
7, 30, 90 Required range:
1 <= x <= 200Response
Per-person, per-model consumption rows + org-wide totals for the window.