GET
/v1/usage/by-key

Query Parameters

days?integer

Rolling window

Default30
Range1 <= value <= 365
month?|

Calendar month YYYY-MM; overrides days

tag?|

Filter to one key tag

Response Body

application/json

application/json

curl -X GET "https://api.sference.com/v1/usage/by-key"
{
  "period_start": "2019-08-24T14:15:22Z",
  "period_end": "2019-08-24T14:15:22Z",
  "items": [
    {
      "api_key_id": "string",
      "name": "string",
      "prefix": "string",
      "tag": "string",
      "owner_email": "string",
      "department_id": "string",
      "revoked": false,
      "last_used_at": "2019-08-24T14:15:22Z",
      "requests": 0,
      "total_tokens": 0,
      "cost_micros": 0
    }
  ],
  "by_tag": [
    {
      "tag": "string",
      "keys": 0,
      "requests": 0,
      "total_tokens": 0,
      "cost_micros": 0
    }
  ]
}
{
  "detail": {
    "type": "about:blank",
    "title": "string",
    "status": 0,
    "detail": "string"
  }
}