Skip to main content
GET
Get API key usage
Includes request counts, token counts, and cost. Requires keys:read or usage:read scope. Naturally idempotent. All parameters, request/response schemas, and examples are auto-generated from the OpenAPI specification.

Authorizations

Authorization
string
header
required

API key authentication. Keys start with ak_ prefix. Example: Authorization: Bearer ak_live_xxxxxxxxxxxx

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier

api_key_id
string<uuid>
required

API key identifier

Query Parameters

period
enum<string>
default:month

Usage aggregation period

Available options:
day,
week,
month

Response

OK

Usage statistics for an API key.

key_id
string
required

API key identifier

workspace_id
string
required

Workspace identifier

period
string
required

Aggregation period (e.g. day, week, month)

start_date
string
required

Period start date

end_date
string
required

Period end date

request_count
integer
required

Total requests made with this key

error_count
integer
required

Number of failed requests

rate_limit_count
integer
required

Number of rate-limited requests

tokens_input
integer
required

Total input tokens

tokens_output
integer
required

Total output tokens

tokens_total
integer
required

Total tokens (input + output)

cost_usd
number
required

Total cost in USD