Get All Sub-Keys Usage
curl --request GET \
--url https://api.io.solutions/v1/api-keys/sub-keys/usage \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.io.solutions/v1/api-keys/sub-keys/usage"
headers = {
"x-api-key": "<x-api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.io.solutions/v1/api-keys/sub-keys/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.io.solutions/v1/api-keys/sub-keys/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>",
"x-api-key: <x-api-key>"
],
]);
$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.io.solutions/v1/api-keys/sub-keys/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
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.io.solutions/v1/api-keys/sub-keys/usage")
.header("x-api-key", "<x-api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.io.solutions/v1/api-keys/sub-keys/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "succeeded",
"data": {
"keys": [
{
"api_key_id": "71775d2e-fbcc-4ef4-aa30-8aaeb82062c0",
"description": "Partner integration key",
"display": "acme-v2-eyJh...c0eQ",
"today": {
"models": [
{
"model_name": "meta-llama/Llama-3.3-70B-Instruct",
"input_tokens": 1500,
"output_tokens": 320,
"credit_cost": 0.000024
}
],
"total_input_tokens": 1500,
"total_output_tokens": 320,
"total_credit_cost": 0.000024
},
"all_time": {
"models": [
{
"model_name": "meta-llama/Llama-3.3-70B-Instruct",
"input_tokens": 48000,
"output_tokens": 12000,
"credit_cost": 0.000834
}
],
"total_input_tokens": 48000,
"total_output_tokens": 12000,
"total_credit_cost": 0.000834
}
}
],
"totals": {
"today_credit_cost": 0.000024,
"all_time_credit_cost": 0.000834
}
}
}Sub-API Keys
Get All Sub-Keys Usage
Returns aggregated token usage and credit cost for every sub-key owned by the admin, broken down by model for today and all time.
GET
/
v1
/
api-keys
/
sub-keys
/
usage
Get All Sub-Keys Usage
curl --request GET \
--url https://api.io.solutions/v1/api-keys/sub-keys/usage \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.io.solutions/v1/api-keys/sub-keys/usage"
headers = {
"x-api-key": "<x-api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.io.solutions/v1/api-keys/sub-keys/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.io.solutions/v1/api-keys/sub-keys/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>",
"x-api-key: <x-api-key>"
],
]);
$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.io.solutions/v1/api-keys/sub-keys/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
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.io.solutions/v1/api-keys/sub-keys/usage")
.header("x-api-key", "<x-api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.io.solutions/v1/api-keys/sub-keys/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "succeeded",
"data": {
"keys": [
{
"api_key_id": "71775d2e-fbcc-4ef4-aa30-8aaeb82062c0",
"description": "Partner integration key",
"display": "acme-v2-eyJh...c0eQ",
"today": {
"models": [
{
"model_name": "meta-llama/Llama-3.3-70B-Instruct",
"input_tokens": 1500,
"output_tokens": 320,
"credit_cost": 0.000024
}
],
"total_input_tokens": 1500,
"total_output_tokens": 320,
"total_credit_cost": 0.000024
},
"all_time": {
"models": [
{
"model_name": "meta-llama/Llama-3.3-70B-Instruct",
"input_tokens": 48000,
"output_tokens": 12000,
"credit_cost": 0.000834
}
],
"total_input_tokens": 48000,
"total_output_tokens": 12000,
"total_credit_cost": 0.000834
}
}
],
"totals": {
"today_credit_cost": 0.000024,
"all_time_credit_cost": 0.000834
}
}
}This endpoint is designed for admin-level billing dashboards. It returns a breakdown per sub-key, with each entry showing:
today— token consumption and credit cost since midnight UTC.all_time— cumulative consumption since the sub-key was created.totals— aggregatetoday_credit_costandall_time_credit_costacross all sub-keys.
models array shows which models were used and their individual costs, allowing you to see exactly where credits are being spent.
This endpoint requires the Intelligence database to be reachable. It returns 503 Service Unavailable if the intelligence database is temporarily unavailable.
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Admin API key. Admin API key (io.net Intelligence)
Was this page helpful?