Anthropic
Connect your Anthropic account to track API costs, model-level usage, and Claude Code analytics in StackSpend.
Anthropic
Direct API billing — Admin API key required
The Anthropic provider connects StackSpend to your Anthropic organization account via the Admin API. Initial sync requests up to 90 days of available history, then scheduled syncs refresh recent data. Billed cost categories and available Claude Code estimated usage remain separate.
What StackSpend tracks
- Daily API costs for the model and token-cost categories returned by the Cost API
- Billed model/token-type cost categories; general API token counts are not fetched
- Available Claude Code user/model token usage and estimated API-equivalent value
- Claude Code token and productivity metrics
- Up to 90 days of initial history requested where available
Prerequisites
- An Anthropic organization account (not a personal account)
- An Admin API key — this must be created from the Admin API section, not the regular API keys section
Setup
Get your Admin API key
Go to console.anthropic.com and navigate to Settings → Admin API Keys. Click Create key and give it a name such as “StackSpend”.
Add to StackSpend
Go to Providers → Add provider → Anthropic:
Add Anthropic provider
Requires an Admin API key (sk-ant-admin...) — not a regular API key
Use your Admin API key (sk-ant-admin...), not a regular API key (sk-ant-api...). The connector rejects the wrong key type.
Verify sync
Check the first successful sync, returned date range and cost basis. Initial history is requested for up to 90 days where available. Claude Code analytics, when enabled and available, is stored separately as estimated usage.
Data summary
| Attribute | Value |
|---|---|
| Data latency | Provider reporting plus scheduled sync |
| Historical data | Up to 90 days where available |
| Setup time | 2 min |
sk-ant-admin...) and not a regular API key (sk-ant-api...). These are different keys created in different sections of the Anthropic console. This connector requires an Admin API key with the sk-ant-admin prefix.Frequently asked questions
What credential does StackSpend need to connect Anthropic?
StackSpend needs an Anthropic Admin API key (sk-ant-admin), created under Settings → Admin API Keys. The connector makes read requests, but the key carries administrative authority. A regular API key (sk-ant-api) is rejected with a key-type error.
Is the connection read-only?
StackSpend makes read requests for billed cost categories and available Claude Code analytics. The Admin key itself has broader authority. General API token counts and workspace chargeback are not guaranteed; Claude Code estimates are kept separate from billed spend.
How long does setup take and how much history loads?
Once the Admin key is ready, connection setup takes a few minutes. Initial sync requests up to 90 days where available; source reporting and scheduled sync determine freshness.
Why don't I see any cost data yet?
Data appears after provider reporting and a successful sync. If sync fails with an authentication error, confirm you used an Admin API key (sk-ant-admin) and not a regular API key (sk-ant-api). Claude Code analytics have their own reporting delay; verify the returned date range and latest successful sync.