Usage of the whole account
curl --request GET \
--url https://api.deapi.ai/api/v2/account/usage \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deapi.ai/api/v2/account/usage"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://api.deapi.ai/api/v2/account/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.deapi.ai/api/v2/account/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 => [
"Accept: <accept>",
"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.deapi.ai/api/v2/account/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "<accept>")
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.deapi.ai/api/v2/account/usage")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v2/account/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"from": "2026-09-15T00:00:00+00:00",
"to": "2026-09-22T00:00:00+00:00",
"group_by": "day",
"currency": "USD",
"totals": {
"cost": 12.345678,
"requests": 830,
"errors": 4
},
"groups": [
{
"cost": 12.345678,
"requests": 830,
"errors": 4,
"key": "2026-09-21",
"name": "<string>"
}
]
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123,
"code": "missing_key"
}{
"message": "This API key does not have permission to access this endpoint.",
"code": "insufficient_permissions"
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123,
"code": "missing_key"
}{
"message": "Too Many Attempts."
}Account
Get Account Usage
Cost, requests and errors of every key of the account, optionally per key. The same data as the Usage screen in the Dashboard. Needs an ADMIN key.
GET
/
api
/
v2
/
account
/
usage
Usage of the whole account
curl --request GET \
--url https://api.deapi.ai/api/v2/account/usage \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deapi.ai/api/v2/account/usage"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://api.deapi.ai/api/v2/account/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.deapi.ai/api/v2/account/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 => [
"Accept: <accept>",
"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.deapi.ai/api/v2/account/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "<accept>")
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.deapi.ai/api/v2/account/usage")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v2/account/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"from": "2026-09-15T00:00:00+00:00",
"to": "2026-09-22T00:00:00+00:00",
"group_by": "day",
"currency": "USD",
"totals": {
"cost": 12.345678,
"requests": 830,
"errors": 4
},
"groups": [
{
"cost": 12.345678,
"requests": 830,
"errors": 4,
"key": "2026-09-21",
"name": "<string>"
}
]
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123,
"code": "missing_key"
}{
"message": "This API key does not have permission to access this endpoint.",
"code": "insufficient_permissions"
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123,
"code": "missing_key"
}{
"message": "Too Many Attempts."
}Requires an ADMIN key. An API key gets
403 with code: insufficient_permissions — see API Keys.day, hour, type, model or key.
With group_by=key, each group’s key is the id of an existing key, panel for jobs started from the Dashboard itself (such as the Playground), deleted for all keys that have since been deleted, or null when the source of a request is unknown.Authorizations
Sanctum personal access token, sent as Authorization: Bearer <token>. The token is opaque — it carries no claims and no embedded expiry, so do not attempt to decode it. Issue and revoke tokens from your account dashboard.
Headers
Available options:
application/json Query Parameters
Start of the range, UTC, inclusive. Default: 7 days before to. Cannot be older than the data retention (90 days).
Example:
"2026-09-15T00:00:00Z"
End of the range, UTC, exclusive. Default: now. An hourly breakdown covers at most 31 days.
Example:
"2026-09-22T00:00:00Z"
Available options:
day, hour, type, model, key Response
The report.
Show child attributes
Show child attributes
Was this page helpful?