First request changedmanage-claude/claude-code-analytics-api
Nearest release: v2.1.319, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+13added
Lines−9removed
From line
23
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits15to this page, all time
### Can this API return real-time metrics? ### How do you calculate tool acceptance rates? ### Can I get real-time metrics? ### How do I calculate tool acceptance rates?
The whole hunk
from line 23, old and new numbered
/
from line 23
2323</Check>
2424
2525<Note>
26 **Claude Platform on AWS:** The Claude Code Analytics API is not currently available. View Claude Code usage on the **Usage** page in the Claude Console instead.
26 The Claude Code Analytics API is available on the Claude API. If you’re using Claude Platform on AWS, view Claude Code usage on the **Usage** page in the Claude Console instead.
2727</Note>
2828
2929<Note>
from line 48
4848 If you’re building an integration, set your User-Agent header to help Anthropic understand usage patterns:
4949
5050 ```text wrap
51 User-Agent: YourApp/1.0.0 (https://yourapp.com)
51 User-Agent: YourApp/1.0.0 (https://example.com)
5252 ```
5353</Tip>
5454
from line 59
5959### Key concepts
6060
6161* **Daily aggregation:** Returns metrics for a single day specified by the `starting_at` parameter
62* **User-level data:** Each record represents one user’s activity for the specified day
62* **Actor-level data:** An actor (a user or API key) can have several records for the specified day, one for each combination of `terminal_type`, `customer_type`, `subscription_type`, and `is_remote` values
6363* **Productivity metrics:** Track sessions, lines of code, commits, pull requests, and tool usage
6464* **Token and cost data:** Monitor usage and estimated costs broken down by Claude model
6565* **Cursor-based pagination:** Handle large datasets with stable pagination using opaque cursors
from line 106
106106
107107### Available metrics
108108
109Each response record contains the following metrics for a single user on a single day:
109Each response record contains the following metrics for one combination of dimension values. An actor can have several records for the same day. Add up an actor’s records to get its daily totals.
110110
111111#### Dimensions
112112
from line 115
115115* **organization\_id:** Organization UUID
116116* **customer\_type:** Type of customer account (`api` or `subscription`); records cover only usage authenticated against your Claude Console organization
117117* **terminal\_type:** Type of terminal or environment where Claude Code was used (for example, `vscode`, `iTerm.app`, `tmux`)
118* **subscription\_type:** Subscription type reported with the usage (`enterprise` or `team`), or `null` if there is none
119* **is\_remote:** Whether the usage came from remote Claude Code sessions (`true`) or local sessions (`false`)
118120
119121#### Core metrics
120122
from line 143
141143* **tokens.input/output:** Input and output token counts for this model
142144* **tokens.cache\_read/cache\_creation:** Cache-related token usage for this model
143145* **estimated\_cost.amount:** Estimated cost in cents USD for this model
144* **estimated\_cost.currency:** Currency code for the cost amount (currently always `USD`)
146* **estimated\_cost.currency:** Currency code for the cost amount (always `USD`)
145147
146148### Response structure
147149
from line 156
154156 "date": "2025-09-08T00:00:00Z",
155157 "actor": {
156158 "type": "user_actor",
157 "email_address": "[email protected]"
159 "email_address": "[email protected]"
158160 },
159161 "organization_id": "dc9f6c26-b22c-4831-8d01-0446bada88f1",
160162 "customer_type": "api",
161163 "terminal_type": "vscode",
164 "subscription_type": null,
165 "is_remote": false,
162166 "core_metrics": {
163167 "num_sessions": 5,
164168 "lines_of_code": {
from line 237
233237
234238Claude Code analytics data typically appears within 1 hour of user activity completion. To ensure consistent pagination results, only data older than 1 hour is included in responses.
235239
236### Can I get real-time metrics?
240### Can this API return real-time metrics?
237241
238242No, this API provides daily aggregated metrics only. For real-time monitoring, consider using the [OpenTelemetry integration](https://code.claude.com/docs/en/monitoring-usage).
239243
from line 266
262266
263267### Which Claude Code deployments are supported?
264268
265This API only tracks Claude Code usage on the Claude API. Usage through [Claude in Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock), [Claude in Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), [Claude Models on Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/overview), or [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) is not included.
269This API only tracks Claude Code usage on the Claude API.
266270
267271### What does it cost to use this API?
268272
269273The Claude Code Analytics API is free to use for all organizations with access to the Admin API.
270274
271### How do I calculate tool acceptance rates?
275### How do you calculate tool acceptance rates?
272276
273277Tool acceptance rate = `accepted / (accepted + rejected)` for each tool type. For example, if the edit tool shows 45 accepted and 5 rejected, the acceptance rate is 90 percent.
274278
No line in this hunk matches that.