You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[anthropic_usage_and_costs] Update README to include information about setting up analytics keys (DataDog#23852)
* README changes to add analytics information
* more readme updates
* more readme
* ascii
* Apply suggestions from code review
Co-authored-by: Eva Parish <eva.parish@datadoghq.com>
* Apply suggestion from @evazorro
---------
Co-authored-by: Eva Parish <eva.parish@datadoghq.com>
Copy file name to clipboardExpand all lines: anthropic_usage_and_costs/README.md
+29-11Lines changed: 29 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,37 +2,54 @@
2
2
3
3
## Overview
4
4
5
-
Datadog's Anthropic Usage and Costs integration allows you to get visibility into your Anthropic usage and associated costs. By ingesting data from Anthropic's newly released Admin usage and cost API, this integration enables your teams to:
5
+
Datadog's Anthropic Usage and Costs integration allows you to get visibility into your Anthropic usage and associated costs. By ingesting data from Anthropic's Admin and Analytics usage and cost APIs, this integration enables your teams to:
6
6
7
7
-**Monitor LLM token consumption** (input, output, cache usage) in near real-time
8
8
-**Track costs** by model, workspace, and service tier, supporting accurate attribution and budgeting
9
+
-**Attribute usage and spend to individual users** (Enterprise plans): break down token consumption and dollar cost by user, product (API, Claude Code, Claude.ai), context window, inference geography, and speed
9
10
-**Understand usage trends** across teams, API keys, or users to optimize model usage
10
11
-**Set up alerting and dashboards** that highlight anomalies in usage or unexpected cost spikes
11
12
12
13
This integration is especially valuable for teams using Anthropic at scale who want to manage spend, understand product adoption, and ensure efficient use of AI resources-all within Datadog. With this data you will be able to introduce and validate optimization strategies to get the best out of Anthropic.
13
14
14
-
You can also see your Anthropic costs in Datadog [Cloud Cost Management][6], allowing you to answer key questions: Which models or workspaces are generating the most cost? Are workloads using the right service tier (Standard, Batch, or Priority)? Are teams effectively using caching or ephemeral sessions? What's the cost breakdown between Claude Opus and Claude Sonnet?
15
+
You can also see your Anthropic costs in Datadog [Cloud Cost Management][6], allowing you to answer key questions: Which models or workspaces are generating the most cost? Which users or teams are driving the most spend? Are workloads using the right service tier (Standard, Batch, or Priority)? Are teams effectively using caching or ephemeral sessions? What's the cost breakdown between Claude Opus and Claude Sonnet?
15
16
16
17
**Minimum Agent version:** 7.69.0
17
18
18
19
## Setup
19
20
20
-
To get started with the Anthropic Admin API integration in Datadog, follow the steps below:
21
+
To get started with the Anthropic integration in Datadog, follow the steps below:
21
22
22
-
### 1. Generate an Admin API Key
23
+
### 1. Identify your Anthropic plan and the key type you'll use
23
24
24
-
You will need an [Admin API key][5] from Anthropic. This key allows access to usage and cost reports across your organization.
25
+
Your Anthropic organization is on either a **Platform** plan or an **Enterprise** plan, and the plan determines which API key type you use to authenticate this integration:
25
26
26
-
1. Navigate to your organization's settings or reach out to your Anthropic account admin to create a new Admin API key.
27
-
2. Copy the API key to a secure location.
27
+
| Anthropic plan | API key type | Data ingested |
28
+
| --- | --- | --- |
29
+
|**Platform**|**Admin API key**| Organization-wide usage and cost, broken down by model, workspace, API key, and service tier. |
30
+
|**Enterprise**|**Analytics API key**| Per-user usage and cost, broken down by user, product (API, Claude Code, Claude.ai), model, context window, inference geography, and speed. Usage metrics are emitted in **1-hour buckets** after the hour closes on Anthropic's side, with a typical end-to-end latency of **1-3 hours**. Per-user cost data covers usage from **January 1, 2026** onward. |
28
31
29
-
### 2. Configure the Datadog Integration
32
+
Each Anthropic organization issues only one of these key types based on its plan, so most customers will configure exactly one key. If your company operates more than one Anthropic organization (for example, a Platform org and an Enterprise org), configure each one as a separate Datadog account.
33
+
34
+
All metrics and Cloud Cost Management line items emitted from an Enterprise (Analytics) account carry the `org_type:enterprise` tag. Platform (Admin) data is emitted without an `org_type` tag, so you can separate the two data sources in dashboards, monitors, and Cloud Cost Management filters using the presence (or absence) of `org_type:enterprise`.
35
+
36
+
### 2. Generate your Anthropic API key
37
+
38
+
Follow the path that matches your Anthropic plan:
39
+
40
+
-**Platform plan**: Generate an [Admin API key][5] from your Anthropic organization's settings, or ask your Anthropic account admin to create one for you.
41
+
-**Enterprise plan**: Generate an Analytics API key (with the `read:analytics` scope) at [claude.ai/analytics/api-keys][7]. Analytics API keys must be provisioned by your organization's **Primary Owner**.
42
+
43
+
Copy the API key to a secure location after you generate it.
44
+
45
+
### 3. Configure the Datadog integration
30
46
31
47
1. In Datadog, go to [**Integrations > Anthropic Usage and Costs**](https://app.datadoghq.com/integrations?integrationId=anthropic-usage-and-costs).
32
-
2. In the configuration panel, provide the **Admin API Key** by pasting the key you generated from Anthropic.
33
-
3. Click **Save Configuration**.
48
+
2. In the configuration panel, paste your **Admin API Key** or **Analytics API Key** into the API key field. Datadog automatically detects the key type and ingests the appropriate usage and cost data.
49
+
3. (Optional) Enable **Cost data ingestion** to send cost data to [Cloud Cost Management][6]. This requires Cloud Cost Management to be enabled on your Datadog account.
50
+
4. Click **Save Configuration**.
34
51
35
-
Once saved, Datadog will begin polling Anthropic usage and cost endpoints using this key and populate metrics in your environment.
52
+
After you save the configuration, Datadog begins polling the appropriate Anthropic usage and cost endpoints and populates metrics in your environment. Usage metrics typically appear within 10 minutes, and cost data appears in Cloud Cost Management within 24 hours.
36
53
37
54
## Data Collected
38
55
@@ -58,3 +75,4 @@ Need help? Contact [Datadog support][3].
0 commit comments