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>"
}
]
}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.
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
Start time (RFC3339). Defaults to 30 days ago.
End time (RFC3339). Defaults to now.
Comma-separated list of sections to include. Options: summary, balance, by_chain, by_api_key, by_api_key_chain, top_methods, time_series, by_scenario. Default: summary,balance.
"summary,balance,by_chain,by_api_key"
Group usage by a dimension. Options: chain, api_key, api_key,chain, method, day.
"chain"
Time bucket size. Options: day, hour. Default: day.
day, hour Filter by chain ID (e.g. 1, 137, 8453).
Filter by API key numeric ID (found in list response).
Maximum number of rows returned (default and max depend on config).
x >= 1Response
Usage data
Show child attributes
Show child attributes
Aggregate credits and request count.
Show child attributes
Show child attributes
Current credit balance.
Show child attributes
Show child attributes
Per-chain breakdown.
Show child attributes
Show child attributes
Per-API-key breakdown.
Show child attributes
Show child attributes
Per-API-key, per-chain breakdown.
Show child attributes
Show child attributes
Top RPC methods by spend.
Show child attributes
Show child attributes
Time-bucketed usage data.
Show child attributes
Show child attributes
Usage by routing outcome scenario.
Show child attributes
Show child attributes
Grouped results when group_by is specified.
Show child attributes
Show child attributes

