CumulusDocs
Open Studio
On this page

Summarize usage

Read metered usage by agent, run or day. Use purpose=test for usage that is measured but not billed, and check completeness.

Operation ID: usage.summary.

Request

GET /api/v1/usage

  • TypeScript SDK: client.usage.summary (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "usage.summary" (path arguments use input.path). Legacy alias: usage_summary. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: viewer.
  • Idempotency: No idempotency header required.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Read billable usage grouped by day for this explicit UTC range. Use purpose: test for metered test usage; follow next_cursor when the response has another page. A usage report does not prove a business outcome or final invoice.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS "${CUMULUS_BASE_URL%/}/api/v1/usage?group_by=day&from=2026-10-01T00%3A00%3A00Z&to=2026-10-08T00%3A00%3A00Z&purpose=billable&limit=50" \
  -H "Authorization: Bearer $CUMULUS_API_KEY"

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const response = await client.usage.summary({
  "query": {
    "group_by": "day",
    "from": "2026-10-01T00:00:00Z",
    "to": "2026-10-08T00:00:00Z",
    "purpose": "billable",
    "limit": 50
  }
});

Input schema

Path, query and header parameters

cursor

query parameter · Optional.

Type: string. maxLength: 1024.

limit

query parameter · Optional.

Type: integer. At least 1. At most 200. Default: 50.

group_by

query parameter · Required.

Type: "agent" · "run" · "day".

from

query parameter · Required.

Type: string (date-time). pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.

to

query parameter · Required.

Type: string (date-time). pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.

agent_id

query parameter · Optional.

Type: string. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.

purpose

query parameter · Optional.

Type: "billable" · "test". Default: "billable".

JSON request body

This operation has no JSON request body.

Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [
    {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "maxLength": 1024
      }
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
        "default": 50,
        "type": "integer",
        "minimum": 1,
        "maximum": 200
      }
    },
    {
      "name": "group_by",
      "in": "query",
      "required": true,
      "schema": {
        "type": "string",
        "enum": [
          "agent",
          "run",
          "day"
        ]
      }
    },
    {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
      }
    },
    {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
      }
    },
    {
      "name": "agent_id",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256,
        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
      }
    },
    {
      "name": "purpose",
      "in": "query",
      "required": false,
      "schema": {
        "default": "billable",
        "description": "billable: non-test runs (the billable report); test: test runs, metered and not billed",
        "type": "string",
        "enum": [
          "billable",
          "test"
        ]
      }
    }
  ],
  "requestBody": null
}

Responses

HTTP 200

Summarize metered usage by agent, run or day: the billable runs, or (purpose=test) the test runs, metered and not billed

application/json

FieldType or valuesRequiredDescription and limits
windowobjectRequired—
window.fromstring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.
window.tostring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.
group_by"agent" · "run" · "day"Required—
purpose"billable" · "test"Required—
rowsarray of objectRequired—
rows[].keystringRequiredminLength: 1. maxLength: 256.
rows[].runsintegerRequiredAt least 0. At most 9007199254740991.
rows[].connected_msintegerRequiredAt least 0. At most 9007199254740991.
rows[].llm_input_tokensinteger or nullRequiredAt least 0. At most 9007199254740991.
rows[].llm_output_tokensinteger or nullRequiredAt least 0. At most 9007199254740991.
rows[].stt_msinteger or nullRequiredAt least 0. At most 9007199254740991.
rows[].tts_charactersinteger or nullRequiredAt least 0. At most 9007199254740991.
rows[].costobjectRequired—
rows[].cost.currency"USD"Required—
rows[].cost.amountstring or nullRequiredpattern: ^(0|[1-9][0-9]*)(.[0-9]{1,12})?$.
rows[].cost.completeness"complete" · "partial" · "unpriced"Required—
completeness"complete" · "partial"Required—
next_cursorstring or nullRequiredCursor for the next page; null when no next page exists. maxLength: 1024.

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "200": {
    "description": "Summarize metered usage by agent, run or day: the billable runs, or (purpose=test) the test runs, metered and not billed",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UsageSummaryResponse200"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

Referenced schemas

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI JSON
{
  "components": {
    "schemas": {
      "UsageSummaryResponse200": {
        "type": "object",
        "properties": {
          "window": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "group_by": {
            "type": "string",
            "enum": [
              "agent",
              "run",
              "day"
            ]
          },
          "purpose": {
            "type": "string",
            "enum": [
              "billable",
              "test"
            ]
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "runs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "connected_ms": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "llm_input_tokens": {
                  "nullable": true,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "llm_output_tokens": {
                  "nullable": true,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "stt_ms": {
                  "nullable": true,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tts_characters": {
                  "nullable": true,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "cost": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD"
                      ]
                    },
                    "amount": {
                      "nullable": true,
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,12})?$"
                    },
                    "completeness": {
                      "type": "string",
                      "enum": [
                        "complete",
                        "partial",
                        "unpriced"
                      ]
                    }
                  },
                  "required": [
                    "currency",
                    "amount",
                    "completeness"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "key",
                "runs",
                "connected_ms",
                "llm_input_tokens",
                "llm_output_tokens",
                "stt_ms",
                "tts_characters",
                "cost"
              ],
              "additionalProperties": false
            }
          },
          "completeness": {
            "type": "string",
            "enum": [
              "complete",
              "partial"
            ]
          },
          "next_cursor": {
            "nullable": true,
            "type": "string",
            "maxLength": 1024
          }
        },
        "required": [
          "window",
          "group_by",
          "purpose",
          "rows",
          "completeness",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}

Errors and recovery

See API error handling and Troubleshooting.

Content version ee7827e1Customer SDKMarkdown source
Summarize usage · Cumulus developer docs