cURL
curl --request GET \
--url https://api.relay.link/metrics/usageconst options = {method: 'GET'};
fetch('https://api.relay.link/metrics/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.relay.link/metrics/usage"
response = requests.get(url)
print(response.text){
"metrics": [
{
"apiKey": "<string>",
"apiKeyId": "<string>",
"appId": "<string>",
"timestamp": "<string>",
"endpoint": "<string>",
"statusCode": 123,
"errorCode": "<string>",
"count": 123
}
]
}API Reference
Get Usage
Get API call counts for the authenticated API key, or for owned keys and Apps when using x-dev-portal-key. Rows are grouped by API key, endpoint, status code, and error code.
GET
/
metrics
/
usage
cURL
curl --request GET \
--url https://api.relay.link/metrics/usageconst options = {method: 'GET'};
fetch('https://api.relay.link/metrics/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.relay.link/metrics/usage"
response = requests.get(url)
print(response.text){
"metrics": [
{
"apiKey": "<string>",
"apiKeyId": "<string>",
"appId": "<string>",
"timestamp": "<string>",
"endpoint": "<string>",
"statusCode": 123,
"errorCode": "<string>",
"count": 123
}
]
}Headers
Query Parameters
Filter by owned Apps (app_id_, comma-separated); requires x-dev-portal-key. Includes all current keys, including inactive keys. OR matching with apiKey and apiKeyId; maximum 50 filter values combined before expanding Apps to keys. Rows remain grouped by API key. App attribution is resolved at read time: hard-deleted keys drop out and reassigned keys attribute all retained usage to their current App. Retention is 24h minutely, 7d hourly, and 14d daily.
Was this page helpful?