Claude Enterprise Integration
Customer Onboarding Guide — Claude Enterprise Analytics API
TL;DR
What this does: Connects OneLens to your Claude Enterprise organization to provide per-user cost attribution, token usage analytics, engagement tracking, and adoption insights across all Claude products — chat, Claude Code, Cowork, Office Agent, and Claude in Chrome — through a single API integration.
Time required: ~10 minutes
Who you need: A Primary Owner in your Claude Enterprise organization (to provision the Analytics API key).
What OneLens reads: Aggregate per-user token counts, USD costs, engagement metrics, and adoption data via Anthropic's Enterprise Analytics API. Your prompts, conversations, and model outputs are never accessed.
What You'll Get Once Connected
Per-User Cost Attribution
Ranks users by spend across all Claude surfaces, with discounted and list-price amounts.
Per-User Token Usage
Breaks down token consumption per user by model, product surface, and context window tier.
Product Surface Breakdown
Separates usage and cost across Claude chat, Claude Code, Cowork, Office Agent, and Claude in Chrome — all from a single API.
Per-Model Cost Analysis
Breaks down cost by Claude model (Opus, Sonnet, Haiku) per user and per product surface.
Engagement Analytics
Tracks daily/weekly/monthly active users, seat utilization, and adoption trends over time.
Project Adoption Tracking
Monitors which Claude projects are used, by how many users, and how often.
Skill & Connector Usage
Identifies which skills and MCP connectors are adopted across your organization.
Fast Mode & Data Residency Tracking
Tracks fast mode usage (6x pricing for Opus 4.6/4.7) and data residency multiplier (1.1x for inference_geo: "us") as separate cost dimensions.
Web Search & Code Execution Costs
Monitors web search ($10/1K searches) and code execution costs as distinct line items.
Budget & Spend Alerts
Tracks per-user and organization-level spend against configurable thresholds.
Anomaly Detection
Flags unexpected cost or usage spikes by user, model, or product surface.
Deleted User Handling
Users who leave the organization appear as "Deleted User" in cost attribution with historical data preserved.
Security at a Glance
Does OneLens read our prompts or model outputs?
No. OneLens reads only aggregate usage metrics (token counts), cost data, and engagement counters. No prompt content, conversation text, or model responses are accessed.
Does OneLens see conversation content or file uploads?
No. The Analytics API returns only counts (e.g., distinct_files_uploaded_count), token totals, model identifiers, and dollar amounts — never content.
Is the API key read-only?
Yes. The analytics key with read:analytics scope is genuinely read-only. It cannot modify any resources in your organization.
What authentication is used?
An analytics API key with read:analytics scope, provisioned by a Primary Owner at claude.ai/analytics/api-keys. This is a long-lived bearer token passed in the x-api-key header. It does not expire automatically — see Key Lifecycle below.
How is data transmitted and stored?
All API calls use TLS 1.2+ in transit. Credentials are encrypted at rest using GCP KMS. API keys are stored securely in OneLens infrastructure, encrypted at rest, and access is strictly scoped.
Can I restrict by IP?
Anthropic does not currently offer IP allowlisting for the Analytics API. Access is controlled via API key scoping and Primary Owner provisioning.
Cost of the Integration
OneLens reads metadata via Anthropic's Enterprise Analytics REST API. There is no compute, storage, or egress cost on Anthropic's side.
API calls
Daily polling: engagement (1 call/day) + cost/usage (4 calls/day)
$0 (no per-request charge)
Data egress
JSON metadata responses, <5 MB/day
$0
Compute in your account
None — OneLens calls Anthropic's hosted API
$0
Storage in your account
None
$0
Estimated total
$0/month on your Anthropic bill
Anthropic does not charge for Analytics API requests. The only cost is your existing Claude Enterprise subscription and usage, which OneLens helps you optimize.
How It Works
The Claude Enterprise Analytics API provides programmatic access to engagement, adoption, usage, and cost data across all Claude surfaces within your Enterprise organization through a single integration point. No per-product setup is needed — one API key covers everything.
The API is organized into two endpoint families:
Engagement & Adoption: Per-user daily engagement metrics across Claude chat, Claude Code, Cowork, Office Agent, and Claude in Chrome (message counts, session counts, project usage, file uploads, artifact creation, skill/connector usage, git activity). Organization-level DAU/WAU/MAU, seat utilization. Per-project and per-skill/connector adoption data.
Cost & Usage: Per-user token usage and USD cost (discounted and list-price), ranked by consumption or spend. Bucketed token usage and cost over time (1m, 1h, 1d), with grouping by product surface, model, context window, inference region, speed, cost type, and token type. All cost amounts are reported as decimal strings in cents (e.g., "41280.000000" = $412.80). OneLens parses these as arbitrary-precision decimals to avoid floating-point rounding errors on large values.
OneLens polls the Enterprise Analytics API once daily. All data is normalized into a unified cost model alongside your other AI providers.
Prerequisites
A Claude Enterprise plan (this API is not available on Team or individual plans)
A user with the Primary Owner role in the Enterprise organization
Access to claude.ai
What OneLens Will Access
GET /v1/organizations/analytics/summaries
DAU/WAU/MAU, seat utilization, pending invites
GET /v1/organizations/analytics/users
Per-user engagement metrics across all Claude surfaces
GET /v1/organizations/analytics/apps/chat/projects
Per-project adoption data
GET /v1/organizations/analytics/skills
Skill usage by surface
GET /v1/organizations/analytics/connectors
Connector usage by surface
GET /v1/organizations/analytics/user_usage_report
Per-user token usage ranked by consumption
GET /v1/organizations/analytics/user_cost_report
Per-user USD cost ranked by spend
GET /v1/organizations/analytics/usage_report
Bucketed token usage over time
GET /v1/organizations/analytics/cost_report
Bucketed USD cost over time
What OneLens Will NOT Access
Messages or conversation content
File uploads or artifact content
User account management (create, update, delete)
Organization settings or configuration
Any write operations of any kind
Verify the Connection
After connecting, OneLens runs a validation check:
Calls GET /v1/organizations/analytics/summaries with a recent date to confirm the key is valid
Calls GET /v1/organizations/analytics/users with the same date to confirm per-user data access
Calls GET /v1/organizations/analytics/user_cost_report to confirm cost data access
If all checks pass, data will begin populating within 24 hours. Historical data for up to 365 days will be backfilled automatically (subject to data freshness delays; cost data available from 2026-01-01 onward).
Data Refresh Schedule
Engagement & adoption (users, summaries, projects, skills, connectors)
Once daily
~4-day delay from activity date
Cost & usage (user_usage_report, user_cost_report, usage_report, cost_report)
Once daily
Typically available within 4 hours of usage; may take up to 24 hours
Key Lifecycle
Analytics API keys do not expire automatically. They remain valid until manually deleted or the public API toggle is disabled.
Only Primary Owners can manage analytics keys at claude.ai/analytics/api-keys.
If the Primary Owner who created the key leaves, another Primary Owner can revoke it. Ensure your organization has more than one Primary Owner for operational continuity.
Disabling the public API toggle immediately blocks all analytics keys, regardless of who created them.
Rotation recommendation: Rotate keys every 90 days as a best practice. Create a new key, update it in OneLens, then delete the old key. OneLens uses the new key on the next daily poll — no downtime.
Data Privacy & Security
No prompt or response content — only aggregate token counts, cost data, and engagement counters are accessed
Genuinely read-only API key — scoped to read:analytics with no write capabilities
TLS 1.2+ for all data in transit
GCP KMS encryption for all credentials and data at rest
API keys stored securely in OneLens infrastructure, encrypted at rest using GCP KMS
No write operations — OneLens never calls POST, PUT, PATCH, or DELETE endpoints
Deleted user handling — users who leave the organization appear as "Deleted User" in historical data; OneLens preserves historical attribution but does not surface PII for deleted users
Data retention — 12-month default, configurable. Deletion within 30 days on request with confirmation.
Frequently Asked Questions
Need Help?
Anthropic Documentation:
OneLens Support: support@astuto.ai · Security: security@astuto.ai
Last updated

