Usage Overview

GET/api/v1/usage/overview

Authorization

AuthorizationBearer <token>

A workspace API key (a13n_...)

In: header

Query Parameters

start*Start
Formatdate-time
end*End
Formatdate-time
principal_id?|

Filter by Run execution identity; requires workspace admin.

group_by?|null
metric?Metric
Default"cost"

Value in

  • "cost"
  • "tokens"
timezone?Timezone
Lengthlength <= 128
Default"UTC"

Header Parameters

X-Workspace-ID?|

The workspace ID a login session acts in; required with a login session. An API key acts in its own workspace and needs none; naming another is forbidden.

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/usage/overview?start=2019-08-24T14%3A15%3A22Z&end=2019-08-24T14%3A15%3A22Z"
{  "daily": [    {      "date": "2019-08-24",      "usage": {        "cache_hit_rate": 0,        "cache_read_tokens": 0,        "cost": "string",        "input_tokens": 0,        "output_tokens": 0,        "requests": 0,        "unpriced_requests": 0      }    }  ],  "runs": {    "average_duration_seconds": 0,    "runs": 0  },  "series": [    {      "daily": [        {          "date": "2019-08-24",          "usage": {            "cache_hit_rate": 0,            "cache_read_tokens": 0,            "cost": "string",            "input_tokens": 0,            "output_tokens": 0,            "requests": 0,            "unpriced_requests": 0          }        }      ],      "key": "string",      "name": "string"    }  ],  "usage": {    "cache_hit_rate": 0,    "cache_read_tokens": 0,    "cost": "string",    "input_tokens": 0,    "output_tokens": 0,    "requests": 0,    "unpriced_requests": 0  }}