Connect Anthropic
Connect your Anthropic organisation with a Console admin API key so leancosts shows who holds a seat, what each person used in Claude Code, and what the organisation was billed, next to your cloud spend. leancosts is read-only here as everywhere: every call it makes to Anthropic is a GET. For the full posture see Security and data handling.
Before you start
Section titled “Before you start”- You need the Admin role in the Anthropic Console to create an admin API key, and the connections-manage permission in leancosts to add a connection.
- Anthropic and OpenAI are two separate connectors, each switched on independently. These connections are being validated against real organisations, so if the Anthropic row in the Add-connection picker is disabled and reads “Not enabled in this deployment”, there is nothing to set up yet; it opens when it is ready. OpenAI being available says nothing about Anthropic, and the other way round.
What leancosts reads, and what the key allows
Section titled “What leancosts reads, and what the key allows”- What we read. The organisation’s member list and each person’s Claude Code usage, which includes their email address. Check that this is acceptable under your privacy obligations (LGPD, GDPR or your own policy) before connecting; the people on the roster are your users.
- What the key can do. An Anthropic admin key grants more than we use.
leancosts only calls four GET endpoints:
organization,members,usage_report/claude_codeandcost_report. It never creates, edits or deletes anything. We recommend rotating the key after the first backfill. - How it is stored. AES-256-GCM encrypted, the same primitive Azure service-principal secrets use, and never logged or echoed back.
1. Create an admin API key
Section titled “1. Create an admin API key”In the Anthropic Console, open Settings → Admin keys and create a key. Copy it once; the Console will not show it again.
2. Add the connection
Section titled “2. Add the connection”- In leancosts go to Admin → Connections and click Add connection.
- Pick Anthropic. The form asks only for a nickname, a schedule and the key. Picking the row already told leancosts the vendor, and the key is always a Console admin key in this release.
- Give the connection a nickname, paste the key, pick a sync schedule (default every 6 hours) and click Create connection.
- The row shows Validating… while leancosts proves the key against your organisation, then Connected. Test re-runs that check any time and reports the organisation name and member count.
The first sync backfills the roster, the last 90 days of per-person Claude Code usage and the cost report, then runs on the schedule you chose. Sync now and Force refresh work like the cloud connectors; Pause stops the schedule without removing anything.
3. Where the data lands
Section titled “3. Where the data lands”-
Costs gains an Anthropic lens of its own in the cloud focus control once the connection is active (not a shared “LLM vendors” leg) so Anthropic spend is reconcilable on its own and no longer an unexplained delta under “All”.
-
Only usage the cost report confirms as billed becomes a cost line. Usage on a subscription plan is shown as estimated and never mixed into billed spend.
-
AI usage (
LLM usagein the sidebar, under Inform & plan) is one page over both vendors, and it opens as soon as either one is connected. It shows: tokens per day, a breakdown by model, workspace, surface and service tier, the effective rate you are paying per million tokens, and a CSV export. Every money figure there is what the vendor billed; anything the vendor reported without attributing it is shown as such rather than spread across models or people. -
Per-person usage is off by default. The page is team grain until a governance admin turns named individuals on under Admin → Workspace → AI usage privacy. Reading it then needs a specific permission, is written to the audit log every time, and is refused to API tokens entirely. The same screen sets how long identities are kept; past that, usage is anonymised: the identity is folded out and the tokens and cost stay on the day, so your cost history does not move. A single person can also be erased on request.
Removing a connection
Section titled “Removing a connection”Open → Settings → Remove purges the roster, every per-person usage row and every vendor cost row the connection ingested. The data cannot be refreshed once the connection is gone, so removal always purges. Rotate or delete the admin key in the Anthropic Console afterwards.