curl --request GET \
--url https://api.edenai.run/v3/manage/usage/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.edenai.run/v3/manage/usage/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.edenai.run/v3/manage/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.edenai.run/v3/manage/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 => [
"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.edenai.run/v3/manage/usage/"
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.edenai.run/v3/manage/usage/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/usage/")
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{
"usage": [
{
"token": "<string>",
"data": {}
}
]
}Get organization usage
Returns the organization’s aggregated consumption over a date window, as a time series per API key at the requested granularity. Narrow it by feature, provider, member or API key, or get one total per member with group_by=user. Without begin/end the last 7 days are returned. Requires the manage:read scope.
curl --request GET \
--url https://api.edenai.run/v3/manage/usage/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.edenai.run/v3/manage/usage/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.edenai.run/v3/manage/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.edenai.run/v3/manage/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 => [
"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.edenai.run/v3/manage/usage/"
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.edenai.run/v3/manage/usage/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/usage/")
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{
"usage": [
{
"token": "<string>",
"data": {}
}
]
}Authorizations
A management key (created from the organization dashboard or with POST /v3/manage/auth-keys), sent as Authorization: Bearer <management_key>. Inference API keys (sk-eden...) are not accepted on these endpoints.
Query Parameters
First day of the window (inclusive). Provide both begin and end, or neither to get the last 7 days.
Day after the last day of the window (exclusive). The window may not exceed 366 days.
Only count this feature.
1Break the totals down per member.
user- user
user 1Only count usage of this API key (404 if not in the organization).
Only count this phase.
1Only count this provider.
1Granularity of the time series: 1 = day, 2 = week, 3 = month, 4 = year.
1 <= x <= 4Only count this subfeature.
1Only count usage of the API keys with this name. Use base_token for usage not attributed to any key. Ignored when key_id is given.
1Only count usage of this member (404 if not in the organization).
1Response
Organization usage: a time series per API key, or one total per member when
group_by=user is set.
- TokenData · object[]
- UserCostTotal · object[]
Show child attributes
Show child attributes