Claude Platform Docs

Uso

Obtener el uso de tokens por dimensión
UsageListPage beta().organization().analytics().usage().list(params, requestOptions = RequestOptions.none())
GET/v1/organizations/analytics/usage
Requires anthropic-beta: analytics-usage-cost-2026-08-24. Learn how to send beta headers.

Obtiene el uso de tokens en un rango de fechas, desglosado por dimensión.

Models
class BetaAnalyticsUsageGroup { 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[].

enum BetaAnalyticsUsageGroupBy
class BetaAnalyticsUsageItem { endingAt; group; startingAt; usage; }
class BetaAnalyticsUsageMetrics { cacheCreation; cacheReadInputTokens; outputTokens; /* 4 more */ }

The token usage of one row.

BetaCacheCreation cacheCreation

The number of input tokens for cache creation.

long ephemeral1hInputTokens

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

minimum0
long ephemeral5mInputTokens

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

minimum0
long cacheReadInputTokens

The number of input tokens read from the cache.

long outputTokens

The number of output tokens generated.

Optional<Long> requests

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.

long webSearchRequests

The number of web search requests made.

long totalTokens

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

long uncachedInputTokens

The number of uncached input tokens processed.

enum BetaAnalyticsUsageOrderBy
OUTPUT_TOKENS("output_tokens")
REQUESTS("requests")
TIME("time")
TOTAL_TOKENS("total_tokens")
UNCACHED_INPUT_TOKENS("uncached_input_tokens")