Skip to main content
GET
/
v1
/
workspaces
/
{workspace_id}
/
api-keys
/
{api_key_id}
/
usage
Get API key usage
import requests

url = "https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys/{api_key_id}/usage"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
{
  "key_id": "<string>",
  "workspace_id": "<string>",
  "period": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "request_count": 123,
  "error_count": 123,
  "rate_limit_count": 123,
  "tokens_input": 123,
  "tokens_output": 123,
  "tokens_total": 123,
  "cost_usd": 123
}
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