Get usage data
curl --request GET \
--url https://api.routeme.sh/usage \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.routeme.sh/usage"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.routeme.sh/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.routeme.sh/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 => [
"X-Api-Key: <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.routeme.sh/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.routeme.sh/usage")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.routeme.sh/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer_id": 123,
"period": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"summary": {
"credits_consumed": 123,
"request_count": 123,
"credits_per_request": 123
},
"balance": {
"credits": 123,
"as_of": "2023-11-07T05:31:56Z"
},
"by_chain": [
{
"chain_id": "<string>",
"credits_consumed": 123,
"request_count": 123
}
],
"by_api_key": [
{
"api_key_id": 123,
"key_hint": "<string>",
"credits_consumed": 123,
"request_count": 123,
"name": "<string>"
}
],
"by_api_key_chain": [
{
"api_key_id": 123,
"key_hint": "<string>",
"chain_id": "<string>",
"credits_consumed": 123,
"request_count": 123,
"name": "<string>"
}
],
"top_methods": [
{
"method": "<string>",
"credits_consumed": 123,
"request_count": 123
}
],
"time_series": [
{
"bucket": "2023-11-07T05:31:56Z",
"credits_consumed": 123,
"request_count": 123
}
],
"by_scenario": [
{
"scenario": "<string>",
"credits_consumed": 123,
"request_count": 123
}
],
"groups": [
{
"credits_consumed": 123,
"request_count": 123,
"api_key_id": 123,
"name": "<string>",
"key_hint": "<string>",
"chain_id": "<string>",
"method": "<string>",
"scenario": "<string>",
"day": "<string>"
}
]
}Usage
Get usage data
Returns customer-scoped usage aggregates. Supports filtering by time range, chain, API key, grouping, and granularity. By default returns summary and balance.
GET
/
usage
Get usage data
curl --request GET \
--url https://api.routeme.sh/usage \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.routeme.sh/usage"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.routeme.sh/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.routeme.sh/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 => [
"X-Api-Key: <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.routeme.sh/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.routeme.sh/usage")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.routeme.sh/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer_id": 123,
"period": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"summary": {
"credits_consumed": 123,
"request_count": 123,
"credits_per_request": 123
},
"balance": {
"credits": 123,
"as_of": "2023-11-07T05:31:56Z"
},
"by_chain": [
{
"chain_id": "<string>",
"credits_consumed": 123,
"request_count": 123
}
],
"by_api_key": [
{
"api_key_id": 123,
"key_hint": "<string>",
"credits_consumed": 123,
"request_count": 123,
"name": "<string>"
}
],
"by_api_key_chain": [
{
"api_key_id": 123,
"key_hint": "<string>",
"chain_id": "<string>",
"credits_consumed": 123,
"request_count": 123,
"name": "<string>"
}
],
"top_methods": [
{
"method": "<string>",
"credits_consumed": 123,
"request_count": 123
}
],
"time_series": [
{
"bucket": "2023-11-07T05:31:56Z",
"credits_consumed": 123,
"request_count": 123
}
],
"by_scenario": [
{
"scenario": "<string>",
"credits_consumed": 123,
"request_count": 123
}
],
"groups": [
{
"credits_consumed": 123,
"request_count": 123,
"api_key_id": 123,
"name": "<string>",
"key_hint": "<string>",
"chain_id": "<string>",
"method": "<string>",
"scenario": "<string>",
"day": "<string>"
}
]
}Authorizations
Management token from the RouteMesh dashboard (Settings → Management Tokens). Required for customer API endpoints (/api-keys, /usage). Tokens are prefixed rmtm_ and scoped to your account. Authenticate by passing the token in the X-Api-Key header. Separate from RPC service keys (rm_), which authenticate dApp traffic to the routing layer.
Query Parameters
Response
Usage data

