Get Api Key Usage
get_api_key_usageRetrieve cost, request, and error metrics for one API key over a chosen time window, optionally grouped by day, hour, job type, or model.
Instructions
Get one API key's cost, requests and errors over a time window. Without key_id: the key this connection uses, which works with any key; another key needs an ADMIN key.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_api_key_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key_id | No | The key's id; leave out for the key this connection uses | |
| to_date | No | Start or end of the window, YYYY-MM-DD (or YYYY-MM-DDTHH:MM). Optional | |
| group_by | No | Split the figures by day, hour, job type or model. Optional | |
| from_date | No | Start or end of the window, YYYY-MM-DD (or YYYY-MM-DDTHH:MM). Optional |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||