Saltar al contenido principal
4 min de lectura

GET /usage

Retrieve your API key usage statistics including monthly request counts, limits, and rate limit configuration.

GET/api/external/v1/usage

Get API key usage statistics and limits

Authentication

All requests require an API key passed via the X-API-Key header. Alternatively, you can use the Authorization: Bearer YOUR_API_KEY header.

AuthenticationBash
curl -X GET 'https://api.zenovay.com/api/external/v1/usage' \
-H 'X-API-Key: YOUR_API_KEY'

Parameters

This endpoint has no query parameters.

Response

Response (200 OK)JSON
{
"success": true,
"data": {
  "api_key": {
    "id": "ak_8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    "name": "Production API Key",
    "permission": "full_access",
    "website_id": null
  },
  "usage": {
    "monthly_requests": 4521,
    "monthly_limit": 100000,
    "monthly_remaining": 95479,
    "monthly_reset_at": "2026-03-01T00:00:00.000Z",
    "total_requests": 128340
  },
  "rate_limits": {
    "requests_per_minute": 60
  },
  "subscription": {
    "tier": "professional"
  }
},
"timestamp": "2026-02-07T12:00:00.000Z"
}

Response Fields

FieldTypeDescription
api_key.idstringUnique identifier for the API key
api_key.namestringHuman-readable name of the API key
api_key.permissionstringPermission scope: full_access or site_access
api_key.website_idstring|nullWebsite ID if scoped to a specific site, null for full access
usage.monthly_requestsnumberRequests made this billing period
usage.monthly_limitnumberMaximum requests allowed per month
usage.monthly_remainingnumberRemaining requests this month
usage.monthly_reset_atstringISO 8601 date when the monthly counter resets
usage.total_requestsnumberTotal requests made with this key since creation
rate_limits.requests_per_minutenumberMaximum requests per minute
subscription.tierstringCurrent subscription tier

Monthly Limits by Tier

TierMonthly API LimitRequests/Minute
Free1,00010
Pro10,00030
Scale100,00060
Enterprise1,000,000120

Legacy tier names (Starter, Professional) are automatically mapped to their current equivalents: Starter maps to Pro, Professional maps to Scale. The API response may still return legacy tier names for backwards compatibility.

TypeScript Interface

UsageResponseTypeScript
interface UsageResponse {
success: true;
data: {
  api_key: {
    id: string;
    name: string;
    permission: 'full_access' | 'site_access';
    website_id: string | null;
  };
  usage: {
    monthly_requests: number;
    monthly_limit: number;
    monthly_remaining: number;
    monthly_reset_at: string;
    total_requests: number;
  };
  rate_limits: {
    requests_per_minute: number;
  };
  subscription: {
    tier: string;
  };
};
timestamp: string;
}

HTTP Status Codes

Status CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Code Examples

cURLBash
curl -X GET 'https://api.zenovay.com/api/external/v1/usage' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json'

Error Handling

Error Response (401 Unauthorized)JSON
{
"success": false,
"error": {
  "message": "Invalid or missing API key",
  "code": "UNAUTHORIZED",
  "timestamp": "2026-02-07T12:00:00.000Z"
}
}
¿Fue útil esta página?