> For the complete documentation index, see [llms.txt](https://docs.onelens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelens.cloud/integrations/ai-integrations/claude-enterprise-integration.md).

# Claude Enterprise Integration

## 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

| Capability                          | What it does                                                                                                                                    |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 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

| Question                                               | Answer                                                                                                                                                                                                                                        |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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.

| Item                    | What it is                                                        | Typical cost                        |
| ----------------------- | ----------------------------------------------------------------- | ----------------------------------- |
| 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

{% hint style="info" %}
**Note on seat-based vs. usage-based plans:** The cost and usage endpoints apply to usage-based Enterprise plans. For seat-based Enterprise plans, these endpoints will reflect usage credits only, not seat-based subscription costs.
{% endhint %}

## What OneLens Will Access

| Endpoint                                            | Purpose                                                |
| --------------------------------------------------- | ------------------------------------------------------ |
| 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

{% stepper %}
{% step %}

## Enable the Analytics API

1. Sign in to claude.ai as a Primary Owner
2. Navigate to claude.ai/analytics/api-keys
3. Toggle the public API access switch to enabled

{% hint style="warning" %}
**WARNING:** If you disable this toggle later, all API requests will be denied immediately — including OneLens polling. You can re-enable it at any time.
{% endhint %}
{% endstep %}

{% step %}

## Create an Analytics API Key

1. On the same page (claude.ai/analytics/api-keys), click **Create Key**
2. Select the `read:analytics` scope
3. Name it **OneLens Integration**
4. Copy the key — store it securely

{% hint style="info" %}
**Note:** Rate limits apply at the organization level, not per key. You can create multiple keys, but they share a single rate limit pool.
{% endhint %}
{% endstep %}

{% step %}

## Verify the Key Works

Run this from your terminal to confirm the key is valid:

```bash
curl -X GET \
  "https://api.anthropic.com/v1/organizations/analytics/summaries?starting_date=2026-05-01" \
  --header "x-api-key: YOUR_ANALYTICS_KEY_HERE"
```

If you get back a JSON response with `daily_active_user_count`, the key is working. Adjust the date to at least 4 days in the past.
{% endstep %}

{% step %}

## Connect to OneLens

Provide the following in the OneLens integration setup:

| Field             | Value                                  | Example            |
| ----------------- | -------------------------------------- | ------------------ |
| Provider          | Anthropic                              | —                  |
| Analytics API Key | Your key with read:analytics scope     | sk-ant-xxxx...xxxx |
| Organization Name | Your Enterprise org name (for display) | Acme Corp          |

{% hint style="info" %}
**Secure key sharing:** Never share API keys over email or chat. Use a validated secure sharing tool like [Password.link](https://password.link/en) to transmit credentials safely.
{% endhint %}
{% endstep %}

{% step %}

## Verify the Connection

After connecting, OneLens runs a validation check:

1. Calls GET /v1/organizations/analytics/summaries with a recent date to confirm the key is valid
2. Calls GET /v1/organizations/analytics/users with the same date to confirm per-user data access
3. 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).
{% endstep %}
{% endstepper %}

## Data Refresh Schedule

| Data source                                                                         | Polling cadence | Source-side latency                                                  |
| ----------------------------------------------------------------------------------- | --------------- | -------------------------------------------------------------------- |
| 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

<details>

<summary>Can OneLens see our conversations, prompts, or file uploads?</summary>

No. The Analytics API returns only aggregate counts (e.g., message\_count, distinct\_files\_uploaded\_count) and never exposes actual conversation text, prompt content, or uploaded file contents.

</details>

<details>

<summary>Can OneLens modify our Claude Enterprise organization?</summary>

No. The analytics API key with read:analytics scope is genuinely read-only. OneLens cannot modify users, projects, settings, or any organizational resources.

</details>

<details>

<summary>Will this integration impact our users' Claude experience?</summary>

No. The Analytics API is separate from Claude's production infrastructure. OneLens polls once daily, which does not affect response times, rate limits, or availability for your users.

</details>

<details>

<summary>Does one API key cover all Claude products?</summary>

Yes. A single analytics API key with read:analytics scope gives OneLens visibility across all Claude surfaces — chat, Claude Code, Cowork, Office Agent, and Claude in Chrome. No per-product setup is needed.

</details>

<details>

<summary>Can I connect multiple Claude Enterprise organizations?</summary>

Yes. Add each organization separately in OneLens with its own analytics API key. Each appears as a distinct source in your unified dashboard.

</details>

<details>

<summary>How do I disconnect OneLens?</summary>

Either disable the public API toggle at claude.ai/analytics/api-keys (immediately blocks all requests) or delete the specific analytics API key. All access is immediately revoked.

</details>

<details>

<summary>How do I rotate the API key?</summary>

Create a new analytics API key at claude.ai/analytics/api-keys, update it in OneLens, then delete the old key. There is no downtime — OneLens uses the new key on the next daily poll. We recommend rotating every 90 days.

</details>

<details>

<summary>What happens when the Primary Owner who created the key leaves?</summary>

Another Primary Owner can manage the key. The key remains functional until explicitly deleted or the public API toggle is disabled. Ensure your organization has more than one Primary Owner for operational continuity.

</details>

<details>

<summary>What about direct Anthropic API usage (console.anthropic.com)?</summary>

This integration covers Claude Enterprise (claude.ai) product surfaces. For direct Anthropic API usage billed through console.anthropic.com, a separate Admin API integration is available — contact OneLens support.

</details>

<details>

<summary>What about Anthropic usage via Amazon Bedrock or Google Vertex AI?</summary>

Bedrock and Vertex AI have their own billing and usage APIs managed by AWS and Google respectively. For Bedrock, connect OneLens via the AWS Bedrock integration. For Vertex AI, use the GCP integration.

</details>

<details>

<summary>Does OneLens see user email addresses?</summary>

Yes — the Analytics API returns user email addresses as part of per-user activity and cost data. OneLens uses these for per-user cost attribution dashboards. Users who have been deleted from the organization appear as "Deleted User" with a null email. Contact OneLens support to discuss anonymization options if your security policy restricts PII handling.

</details>

<details>

<summary>My organization uses Priority Tier. Will I see those costs?</summary>

Priority Tier costs are not included in the cost endpoint directly. OneLens tracks Priority Tier usage via token counts by service tier and applies list-price rates for cost estimation. For exact Priority Tier billing, refer to your Anthropic invoice.

</details>

<details>

<summary>My organization is on a seat-based Enterprise plan. Will cost endpoints work?</summary>

Yes, but cost/usage endpoints will reflect usage credits only, not seat-based subscription costs. Token usage data is still available and useful for understanding consumption patterns.

</details>

<details>

<summary>How far back can I pull historical data?</summary>

The Enterprise Analytics API supports querying up to 365 days in the past, with a maximum of 31 days per query window. No data is available prior to 2026-01-01. OneLens backfills the maximum available history on initial connection.

</details>

## Need Help?

**Anthropic Documentation:**

* [Enterprise Analytics API reference](https://docs.anthropic.com/)
* [Get started with the Enterprise Analytics API](https://docs.anthropic.com/)
* [View usage analytics for Team and Enterprise plans](https://docs.anthropic.com/)
* [Claude Enterprise consumption guide](https://docs.anthropic.com/)
* [Pricing](https://www.anthropic.com/pricing)

**OneLens Support:** <support@astuto.ai> · Security: <security@astuto.ai>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onelens.cloud/integrations/ai-integrations/claude-enterprise-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
