Get API key usage

Changed on

Get usage statistics for a specific API key within a date range

get/v1/manage/apikey/{id}/usage

Request

  • Base URL
    https://api-v2.requesty.ai
  • URL
    https://api-v2.requesty.ai/v1/manage/apikey/{id}/usage
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

Request body

startstring date-time required

Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required. The date range cannot exceed 100 days from start to end.

endstring date-time

End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional. Defaults to 24 hours from start if not specified. Must be after start date. The date range cannot exceed 100 days.

group_bystring[]

Fields to group by: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, user_agent, api, finish_reason, status_code, extra.<field_name>, api_key_label.<label_key>, or group_label.<label_key>. Rows missing a requested label are grouped under "Unknown". Grouping by api returns one group per request type: chat, embedding, image, speech, transcription, or decision. Grouping by user_agent returns one group per client, taken from the User-Agent header with version numbers and parenthesised comments removed and lowercased (for example claude-cli/2.1.221 (external, cli) becomes claude-cli/). Grouping by finish_reason returns one group per finish reason, for example stop or tool_calls, so a coding agent turn that makes several tool calls and ends with stop can be counted by its stop rows. Grouping by status_code returns one group per HTTP status code, with 0 for successful requests.

resolution'hour' | 'day' | 'month'

Time resolution for aggregation

Example request

{
  "start": "2025-01-01T00:00:00Z",
  "end": "2025-01-31T23:59:59Z"
}

Response

Successfully retrieved usage data

usageobject required

Map of period (string) to usage entry

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status