Usage
Usage report
Report metered usage for a billing period.
GET
/
v1
/
usage
Usage report
curl --request GET \
--url https://api.getmillwork.dev/v1/usage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getmillwork.dev/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"by_arm": [
{
"arm_id": "<string>",
"fallback_count": 123,
"input_tokens": 123,
"output_tokens": 123,
"selected_count": 123,
"usd": 123
}
],
"by_day": [
{
"date": "<string>",
"executions": 123,
"passthrough_usd": 123,
"platform_usd": 123,
"usd": 123
}
],
"by_key": [
{
"api_key_id": "<string>",
"by_day": [
{
"date": "<string>",
"usd": 123
}
],
"calls": 123,
"executions": 123,
"input_tokens": 123,
"output_tokens": 123,
"slices": 123,
"top_arms": [
{
"arm_id": "<string>",
"selected_count": 123
}
],
"usd": 123
}
],
"period": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"totals": {
"calls": 123,
"executions": 123,
"input_tokens": 123,
"output_tokens": 123,
"passthrough_usd": 123,
"platform_usd": 123,
"slices": 123,
"usd": 123
}
}{
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"retry_after_s": 123
}{
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"retry_after_s": 123
}Authorizations
bearerAuthsessionCookie
Organization API key for application requests.
Query Parameters
Pattern:
^\d{4}-\d{2}$Minimum string length:
1Minimum string length:
1Minimum string length:
1⌘I
Usage report
curl --request GET \
--url https://api.getmillwork.dev/v1/usage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getmillwork.dev/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"by_arm": [
{
"arm_id": "<string>",
"fallback_count": 123,
"input_tokens": 123,
"output_tokens": 123,
"selected_count": 123,
"usd": 123
}
],
"by_day": [
{
"date": "<string>",
"executions": 123,
"passthrough_usd": 123,
"platform_usd": 123,
"usd": 123
}
],
"by_key": [
{
"api_key_id": "<string>",
"by_day": [
{
"date": "<string>",
"usd": 123
}
],
"calls": 123,
"executions": 123,
"input_tokens": 123,
"output_tokens": 123,
"slices": 123,
"top_arms": [
{
"arm_id": "<string>",
"selected_count": 123
}
],
"usd": 123
}
],
"period": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"totals": {
"calls": 123,
"executions": 123,
"input_tokens": 123,
"output_tokens": 123,
"passthrough_usd": 123,
"platform_usd": 123,
"slices": 123,
"usd": 123
}
}{
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"retry_after_s": 123
}{
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"retry_after_s": 123
}