Get API key usage statistics

Get an overview of how your API key has been used over a specific period. You will receive detailed information on the total number of calls, successful and failed calls, and a breakdown per endpoint and error code. The 'requestId' returned may be needed for follow-up actions in other API calls.

Path Parameters

keyId string required Example

keyId parameter

Query Parameters

days string required

Headers

Accept Example
Content-Type Example

Responses

200
success boolean
timestamp string
requestId string
data object
GET https://cloud.hostup.se/api/keys/{keyId}/stats
For AI assistants
cURL
curl -X GET "https://cloud.hostup.se/api/keys/key_EXAMPLE0002/stats?days=string" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response
{
  "success": true,
  "timestamp": "string",
  "requestId": "string",
  "data": {
    "period_days": 0,
    "totals": {
      "total_requests": "string",
      "successful_requests": "string",
      "failed_requests": "string",
      "avg_response_time": "string"
    },
    "daily_stats": [
      {
        "date": "string",
        "requests": "string",
        "successful": "string",
        "failed_requests": "string",
        "avg_response_time": "string"
      }
    ],
    "endpoint_breakdown": [
      {
        "endpoint": "string",
        "method": "string",
        "requests": "string",
        "successful": "string",
        "avg_response_time": "string"
      }
    ],
    "error_breakdown": [
      "string"
    ]
  }
}