MMTMMT Docs
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/usage

Parameters

This endpoint has no query parameters. Authentication is the only requirement.

Rate Limits

MetricValue
Cost0 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 FieldCBOR KeyTypeDescription
limitLimitintMaximum weight allowance per minute for your tier
remainingRemainingintRemaining weight available in current window
usedUsedintWeight consumed in current window
resetResetint64Unix timestamp when the rate limit window resets
window_secondsWindowSecintDuration 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

CodeHTTPDescription
INVALID_API_KEY401Missing or invalid API key
INTERNAL_ERROR500Internal 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)`);

On this page