curl --request GET \
--url https://api.edenai.run/v2/cost_management/import requests
url = "https://api.edenai.run/v2/cost_management/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.edenai.run/v2/cost_management/', 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/v2/cost_management/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/v2/cost_management/"
req, _ := http.NewRequest("GET", url, nil)
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/v2/cost_management/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v2/cost_management/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"response": [
{
"token": "base_token",
"data": {
"2024-01-01": {
"image__explicit_content": {
"total_cost": 0.03000000000000001,
"details": 20,
"cost_per_provider": {
"google": 0.03000000000000001
}
},
"text__generation": {
"total_cost": 0.065878,
"details": 54,
"cost_per_provider": {
"openai": 0.065878
}
}
},
"2024-02-01": {
"audio__text_to_speech": {
"total_cost": 0.47940000000000005,
"details": 2,
"cost_per_provider": {
"elevenlabs": 0.47940000000000005
}
},
"image__explicit_content": {
"total_cost": 0.023999999999999997,
"details": 16,
"cost_per_provider": {
"google": 0.023999999999999997
}
},
"ocr__ocr": {
"total_cost": 0.006,
"details": 4,
"cost_per_provider": {
"google": 0.006
}
}
},
"2024-03-01": {
"image__explicit_content": {
"total_cost": 0.15150000000000005,
"details": 101,
"cost_per_provider": {
"google": 0.15150000000000005
}
},
"image__question_answer": {
"total_cost": 1.3700000000000003,
"details": 69,
"cost_per_provider": {
"alephalpha": 0.02,
"google": 0.01,
"openai": 1.3400000000000003
}
},
"text__chat": {
"total_cost": 11.303349220000005,
"details": 381,
"cost_per_provider": {
"anthropic": 0.00786,
"cohere": 0.002,
"google": 0.002,
"meta": 0.00182784,
"mistral": 0.00047418,
"openai": 11.285760000000003,
"perplexityai": 0.0034272,
"replicate": 0
}
},
"text__generation": {
"total_cost": 1.093838,
"details": 1019,
"cost_per_provider": {
"openai": 1.093838
}
}
},
"2024-04-01": {
"audio__text_to_speech": {
"total_cost": 0.273,
"details": 5,
"cost_per_provider": {
"elevenlabs": 0.273
}
}
},
"2024-05-01": {
"text__chat": {
"total_cost": 25.151578000000015,
"details": 2041,
"cost_per_provider": {
"google": 0.006500000000000001,
"meta": 2.9662771199999995,
"mistral": 0.027624000000000003,
"openai": 21.665000000000017,
"perplexityai": 0.4861768799999998
}
},
"text__embeddings": {
"total_cost": 0.08262119999999998,
"details": 1671,
"cost_per_provider": {
"cohere": 0.08262119999999998
}
}
}
}
}
]
}{
"error": {
"type": "<string>",
"message": {
"<parameter_name>": [
"<string>"
]
}
}
}{
"error": {
"type": "<string>",
"message": "<string>"
}
}{
"details": "Not Found"
}{
"error": {
"type": "<string>",
"message": "<string>"
}
}Monitor Consumptions
Returns aggregated consumption over time.
Only feature, subfeature, provider, and phase are accepted as row filters; any other unknown query parameter returns 400.
Results are scoped by the caller’s role: an organization owner or a member with members:manage sees the whole organization and may narrow with user, token or group_by=user; a regular member always sees only their own consumption and receives 403 if it sends user or group_by=user.
token matches by key NAME, not by key identity. Names are unique per user and only among non-revoked keys, so a name shared by several members of the organization aggregates all of them, and a name reused after a rotation also includes the rotated-out key’s history. Use base_token to select consumption not attributed to any key.
curl --request GET \
--url https://api.edenai.run/v2/cost_management/import requests
url = "https://api.edenai.run/v2/cost_management/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.edenai.run/v2/cost_management/', 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/v2/cost_management/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/v2/cost_management/"
req, _ := http.NewRequest("GET", url, nil)
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/v2/cost_management/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v2/cost_management/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"response": [
{
"token": "base_token",
"data": {
"2024-01-01": {
"image__explicit_content": {
"total_cost": 0.03000000000000001,
"details": 20,
"cost_per_provider": {
"google": 0.03000000000000001
}
},
"text__generation": {
"total_cost": 0.065878,
"details": 54,
"cost_per_provider": {
"openai": 0.065878
}
}
},
"2024-02-01": {
"audio__text_to_speech": {
"total_cost": 0.47940000000000005,
"details": 2,
"cost_per_provider": {
"elevenlabs": 0.47940000000000005
}
},
"image__explicit_content": {
"total_cost": 0.023999999999999997,
"details": 16,
"cost_per_provider": {
"google": 0.023999999999999997
}
},
"ocr__ocr": {
"total_cost": 0.006,
"details": 4,
"cost_per_provider": {
"google": 0.006
}
}
},
"2024-03-01": {
"image__explicit_content": {
"total_cost": 0.15150000000000005,
"details": 101,
"cost_per_provider": {
"google": 0.15150000000000005
}
},
"image__question_answer": {
"total_cost": 1.3700000000000003,
"details": 69,
"cost_per_provider": {
"alephalpha": 0.02,
"google": 0.01,
"openai": 1.3400000000000003
}
},
"text__chat": {
"total_cost": 11.303349220000005,
"details": 381,
"cost_per_provider": {
"anthropic": 0.00786,
"cohere": 0.002,
"google": 0.002,
"meta": 0.00182784,
"mistral": 0.00047418,
"openai": 11.285760000000003,
"perplexityai": 0.0034272,
"replicate": 0
}
},
"text__generation": {
"total_cost": 1.093838,
"details": 1019,
"cost_per_provider": {
"openai": 1.093838
}
}
},
"2024-04-01": {
"audio__text_to_speech": {
"total_cost": 0.273,
"details": 5,
"cost_per_provider": {
"elevenlabs": 0.273
}
}
},
"2024-05-01": {
"text__chat": {
"total_cost": 25.151578000000015,
"details": 2041,
"cost_per_provider": {
"google": 0.006500000000000001,
"meta": 2.9662771199999995,
"mistral": 0.027624000000000003,
"openai": 21.665000000000017,
"perplexityai": 0.4861768799999998
}
},
"text__embeddings": {
"total_cost": 0.08262119999999998,
"details": 1671,
"cost_per_provider": {
"cohere": 0.08262119999999998
}
}
}
}
}
]
}{
"error": {
"type": "<string>",
"message": {
"<parameter_name>": [
"<string>"
]
}
}
}{
"error": {
"type": "<string>",
"message": "<string>"
}
}{
"details": "Not Found"
}{
"error": {
"type": "<string>",
"message": "<string>"
}
}Query Parameters
user- user
user 11 - 2001 <= x <= 41 - 20011Response
Show child attributes
Show child attributes