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)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys/{api_key_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys/{api_key_id}/usage \
--header 'Authorization: Bearer <token>'{
"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
}{
"error": {
"message": "API key is invalid.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}{
"error": {
"message": "The requested resource was not found.",
"type": "not_found_error",
"param": null,
"code": "resource_not_found"
}
}API Keys
Get API key usage
Returns usage statistics for a specific API key
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)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys/{api_key_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys/{api_key_id}/usage \
--header 'Authorization: Bearer <token>'{
"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
}{
"error": {
"message": "API key is invalid.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}{
"error": {
"message": "The requested resource was not found.",
"type": "not_found_error",
"param": null,
"code": "resource_not_found"
}
}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
Path Parameters
Query Parameters
Response
OK
Usage statistics for an API key.