api-keys

Get Usage

Deprecated — use GET /api/auth/me instead.

The path-parameter form leaks the key into Caddy/proxy access logs. The replacement reads from the X-API-Key header only.

Requires authentication via X-API-Key header. You can only view usage for your own key.

get/api/keys/{api_key}/usage

Request

  • Base URL: https://api.halalterminal.com
  • URL: https://api.halalterminal.com/api/keys/{api_key}/usage
  • Auth: API key in header X-API-Key

Path parameters

api_keystring required

API key whose usage to read.

Response

Usage statistics for the API key

api_keystring required

The API key these stats belong to

emailstring required

Email associated with the key

planstring required

Current plan tier

tokens_usedinteger required

Tokens consumed this billing period

tokens_limitinteger required

Monthly token allowance (-1 = unlimited)

requests_usedinteger required

Total requests consumed

requests_limitinteger required

Maximum requests allowed under the plan

billing_period_startstring nullable

Start of current billing period

billing_period_endstring nullable

End of current billing period

is_activeboolean required

Whether the key is currently active

created_atstring required

ISO-8601 creation timestamp

updated_atstring required

ISO-8601 timestamp of last usage update

price_monthlynumber nullable

Actual monthly price in USD from the key's Stripe subscription (reflects custom pricing). Null when no subscription is attached.

Example response

{
  "api_key": "ht_abc123def456",
  "billing_period_end": "2025-07-01T12:00:00Z",
  "billing_period_start": "2025-06-01T12:00:00Z",
  "created_at": "2025-06-01T12:00:00Z",
  "email": "dev@example.com",
  "is_active": true,
  "plan": "starter",
  "requests_limit": 2500,
  "requests_used": 42,
  "tokens_limit": 2500,
  "tokens_used": 142,
  "top_endpoints": [
    {
      "count": 30,
      "endpoint": "/api/screen",
      "method": "GET",
      "total_tokens": 150
    }
  ],
  "updated_at": "2025-06-15T08:30:00Z"
}

Changes

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