Get TURN Usage
This API endpoint retrieves the current usage, quota, and overage for the current billing cycle.
GET
https://<appname>.metered.live/api/v1/turn/current_usage
<appname>
- replace it the name of your app.
Request
GET /api/v1/turn/credentials
Query Parameters
Parameter | Description | Data Type |
---|---|---|
secretKey | The secret key for authorization | String |
Response
A JSON object containing the following fields:
Field | Description | Data Type |
---|---|---|
quotaInGB | The quota in gigabytes allocated for the current billing cycle | number |
usageInGB | The usage in gigabytes consumed in the current billing cycle | number |
overageInGB | The overage in gigabytes consumed in the current billing cycle | number |
Error Responses
HTTP status code 400: Invalid request. Not subscribed to any turn server plan
HTTP status code 500: Internal error occurred, contact support and provide the event id
Example
Request
GET /api/v1/turn/current_usage?secretKey=mySecretKeyCreatedByApp
Successful Response
{
"quotaInGB": 150,
"usageInGB": 45.12,
"overageInGB": 0
}
Error Response
{
"message": "Invalid request. Not subscribed to any turn server plan"
}