Claude Platform Docs

Usage

Get Token Usage By Dimension
client.Beta.Organization.Analytics.Usage.List(ctx, params) (*ReportPageCursor[BetaAnalyticsUsageItem], error)
GET/v1/organizations/analytics/usage
Requires anthropic-beta: analytics-usage-cost-2026-08-24. Learn how to send beta headers.

Get token usage across a date range, broken out by dimension.

Models
type BetaAnalyticsUsageGroup struct { Actor; ActorType; AgentID; /* 17 more */ }

The dimension values one usage row is broken out by; each is null unless its dimension is in group_by[].

type BetaAnalyticsUsageGroupBy string
One of the following:
type BetaAnalyticsUsageItem struct { EndingAt; Group; StartingAt; Usage }
type BetaAnalyticsUsageMetrics struct { CacheCreation; CacheReadInputTokens; OutputTokens; /* 4 more */ }

The token usage of one row.

CacheCreation BetaCacheCreation

The number of input tokens for cache creation.

Ephemeral1hInputTokens int64

The number of input tokens used to create the 1 hour cache entry.

default0
minimum0
Ephemeral5mInputTokens int64

The number of input tokens used to create the 5 minute cache entry.

default0
minimum0
CacheReadInputTokens int64

The number of input tokens read from the cache.

OutputTokens int64

The number of output tokens generated.

Requests int64

Number of API requests in this row's scope. For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with product: null).

Server-side tool usage metrics.

WebSearchRequests int64

The number of web search requests made.

TotalTokens int64

Total token count across all token types. This is the value the default order_by (total_tokens) sorts on.

UncachedInputTokens int64

The number of uncached input tokens processed.

type BetaAnalyticsUsageOrderBy string
One of the following:
const BetaAnalyticsUsageOrderByOutputTokens BetaAnalyticsUsageOrderBy = "output_tokens"
const BetaAnalyticsUsageOrderByRequests BetaAnalyticsUsageOrderBy = "requests"
const BetaAnalyticsUsageOrderByTime BetaAnalyticsUsageOrderBy = "time"
const BetaAnalyticsUsageOrderByTotalTokens BetaAnalyticsUsageOrderBy = "total_tokens"
const BetaAnalyticsUsageOrderByUncachedInputTokens BetaAnalyticsUsageOrderBy = "uncached_input_tokens"