API Key Management

Get usage statistics for an API key

Returns usage statistics including requests made, remaining quota, tier information, and recent request history. You can only view usage for your own API key.

Authentication required: Pass your API key in the X-API-Key header.

get/keys/{keyId}/usage

Request

  • Base URL: https://api.rateapi.dev
  • URL: https://api.rateapi.dev/keys/{keyId}/usage
  • Auth: API key in header X-API-Key

Path parameters

keyIdstring required
Example:a1b2c3d4e5f6g7h8

The ID of the API key (returned when the key was created)

Response

Usage statistics retrieved successfully

keyIdstring required

The API key ID

organizationIdstring

Organization the key belongs to. Present only for a key connected to an organization; the quota is then pooled across that organization.

Example response

{
  "keyId": "9f4c1ad27b83e650",
  "tier": {
    "level": 1,
    "name": "Free"
  },
  "usage": {
    "used": 25,
    "windowDays": 30,
    "resetAt": "2024-02-15T12:00:00.000Z",
    "scope": "key"
  },
  "recentRequests": [
    {
      "endpoint": "/v1/decisions",
      "timestamp": "2024-01-16T10:30:00.000Z"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.