Team Management

Get API key usage

Changed on

Returns an API key's cost over a time period, in total and by price.

get/api-keys/{id}/usage

Request

  • Base URL
    https://admin-api.exa.ai/team-management
  • URL
    https://admin-api.exa.ai/team-management/api-keys/{id}/usage
  • Auth
    API key in header x-api-key

Path parameters

idstring required

The key's publicId. The key's current secret is also accepted for backward compatibility.

Query parameters

start_datestring date-time

Start date for the usage period (ISO 8601 format). Defaults to 30 days ago. Must be within the last 6 months (180 days).

end_datestring date-time

End date for the usage period (ISO 8601 format). Defaults to current time.

group_by'hour' | 'day' | 'month'

Has no effect on the response.

Response

Usage data retrieved successfully

idstring

The key's publicId, its stable identifier.

api_key_idstring uuid

The API key's secret, kept for backward compatibility. Despite the field name it is not an identifier; use id to identify the key.

api_key_namestring nullable

The name of the API key

team_idstring uuid

The team ID this key belongs to

total_cost_usdnumber

Total cost in USD for the period

Example response

{
  "total_cost_usd": 45.67
}

Changes

    • info

      for the path request parameter id, the format was generalized from uuid to no format

    • info

      added the optional property to the response with the status