REST API
Usage
Check your current rate limit quota status without consuming any tokens.
Returns your current rate limit quota status without consuming any tokens. Use this endpoint to monitor your API usage before making requests.
Authentication
API key via X-API-Key header.
Endpoint
GET /api/v1/usageParameters
This endpoint has no query parameters. Authentication is the only requirement.
Rate Limits
| Metric | Value |
|---|---|
| Cost | 0 weight |
This endpoint does not consume any rate limit tokens. You can call it as frequently as needed to monitor your quota.
Response
{
"limit": 10000,
"remaining": 8500,
"used": 1500,
"reset": 1704067260,
"window_seconds": 60
}limit, remaining, and used are runtime values for your current key and plan.
Types
UsageResponse
| JSON Field | CBOR Key | Type | Description |
|---|---|---|---|
limit | Limit | int | Maximum weight allowance per minute for your tier |
remaining | Remaining | int | Remaining weight available in current window |
used | Used | int | Weight consumed in current window |
reset | Reset | int64 | Unix timestamp when the rate limit window resets |
window_seconds | WindowSec | int | Duration of the rate limit window in seconds (always 60) |
Tip: Call this endpoint before large requests to ensure you have sufficient quota. This helps avoid rate limit errors and allows you to implement client-side throttling.
Errors
| Code | HTTP | Description |
|---|---|---|
INVALID_API_KEY | 401 | Missing or invalid API key |
INTERNAL_ERROR | 500 | Internal server error |
Example Error Response
{
"error": {
"code": "INVALID_API_KEY",
"message": "Missing or invalid API key"
}
}Examples
Basic Request
curl "https://eu-central-1.mmt.gg/api/v1/usage" \
-H "X-API-Key: your-api-key"Python Example
import requests
response = requests.get(
"https://eu-central-1.mmt.gg/api/v1/usage",
headers={"X-API-Key": "your-api-key"}
)
usage = response.json()
print(f"Used: {usage['used']}/{usage['limit']} ({usage['remaining']} remaining)")
# Check if you have enough quota for a large request
estimated_weight = 50
if usage['remaining'] >= estimated_weight:
# Proceed with request
pass
else:
# Wait until reset
import time
wait_time = usage['reset'] - time.time()
print(f"Rate limited, waiting {wait_time:.0f}s")JavaScript Example
const response = await fetch(
'https://eu-central-1.mmt.gg/api/v1/usage',
{ headers: { 'X-API-Key': 'YOUR_KEY' } }
);
const usage = await response.json();
console.log(`Used: ${usage.used}/${usage.limit} (${usage.remaining} remaining)`);