Loading

Anthropic Metrics

Version 0.1.0 (View all)
Subscription level
What's this?
Basic
Developed by
What's this?
Elastic
Ingestion method(s) API
Minimum Kibana version(s) 9.4.0
The Anthropic Metrics integration v0.1.0 is in technical preview

To use pre-release integrations, go to the Integrations page in Kibana, scroll down, and toggle on the Display beta integrations option.

The Anthropic Metrics integration collects API usage, cost, and rate limit data from Anthropic organizations via the Admin APIs. It enables observability and monitoring teams to track token consumption, monitor spend, and surface rate limit configurations for capacity planning.

This integration uses the Anthropic Platform Admin API (platform.claude.com) to collect workspace- and API-key-level cost, usage, and rate limit data. It requires an Anthropic organization on a Team or Enterprise plan with access to the Admin API. Individual accounts (Free, Pro, Max) cannot create the required Admin API keys and are not supported.

Enterprise plan customers can use this integration for workspace- and API-key-level data. For per-user or per-product breakdowns (Chat, Claude Code, Cowork, etc.), the separate Enterprise Analytics API (claude.ai/analytics/api-keys) is required — that API is currently not covered by this integration.

Elastic Agent polls three Anthropic Admin API endpoints on a configurable schedule using the CEL input:

  • Usage API (/v1/organizations/usage_report/messages): Token consumption by model, workspace, and service tier
  • Cost API (/v1/organizations/cost_report): Daily cost breakdown by workspace and model
  • Rate Limits API (/v1/organizations/rate_limits): Per-model rate limit configurations (RPM, ITPM, OTPM)

Token usage metrics aggregated in configurable time buckets (1 minute, 1 hour, or 1 day):

  • Uncached input tokens, cached input tokens, cache creation tokens, and output tokens
  • Breakdowns by model, workspace, service tier, context window, and inference geography

Daily cost data (amounts reported by the API in lowest units (eg cents)):

  • Token usage costs, web search costs, and code execution costs
  • Breakdowns by workspace and description (includes model and inference geography)

Rate limit configuration snapshots:

  • Requests per minute (RPM), input tokens per minute (ITPM), output tokens per minute (OTPM)
  • Model group membership and batch request limits
  • Token usage monitoring: Track consumption trends across models and workspaces
  • Cost management: Monitor daily spend and allocate costs by workspace
  • Capacity planning: Compare rate limits against actual consumption to prevent throttling
  • Finance reporting: Export usage and cost data for billing reconciliation
  • An Anthropic organization (Team or Enterprise) with Platform Admin API access
  • An Admin API key (starts with sk-ant-admin...) provisioned by an organization admin via Claude Console > Settings > Admin keys.
  • Elastic Agent installed on a host with outbound HTTPS access to api.anthropic.com

Agentless integrations allow you to collect data without having to manage Elastic Agent in your cloud. They make manual agent deployment unnecessary, so you can focus on your data instead of the agent that collects it. For more information, refer to Agentless integrations and the Agentless integrations FAQ.

Agentless deployments are only supported in Elastic Serverless and Elastic Cloud environments. This functionality is in beta and is subject to change. Beta features are not subject to the support SLA of official GA features.

Elastic Agent must be installed. For more details, check the Elastic Agent installation instructions. You can install only one Elastic Agent per host.

Elastic Agent polls the Anthropic Admin APIs and ships collected events to Elasticsearch, where they are processed by the integration's ingest pipelines.

  1. Create an Admin API key in the Claude Console with organization admin permissions.
  2. In Kibana, navigate to Management > Integrations and search for Anthropic Metrics.
  3. Click Add Anthropic Metrics and enter the Admin API key.
  4. Configure each data stream using the settings below, then deploy the policy to your Elastic Agent.

After deploying, verify data is flowing by checking the following data streams in Discover:

  • metrics-anthropic_metrics.usage-*
  • metrics-anthropic_metrics.cost-*
  • metrics-anthropic_metrics.rate_limit-*

For help with Elastic ingest tools, check Common problems.

  • HTTP 401 errors: Verify the Admin API key is valid and starts with sk-ant-admin.... Standard API keys do not work with Admin endpoints.
  • HTTP 403 errors: Confirm the key has organization admin permissions and the organization has Admin API access enabled.
  • No data for usage/cost streams: Check that the time window parameters (initial_interval, bucket_width) are configured correctly and that the organization has recent API activity.

For more information on architectures that can be used for scaling this integration, check the Ingest Architectures documentation.

The usage data stream collects token usage metrics from the Anthropic Usage API.

The cost data stream collects daily cost data from the Anthropic Cost API.

The rate_limit data stream collects rate limit configuration from the Anthropic Rate Limits API.

This integration includes one or more Kibana dashboards that visualizes the data collected by the integration. The screenshots below illustrate how the ingested data is displayed.