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. Once connected, StackSpend pulls your full billing history on first sync, then keeps it current in real time as new usage accrues.
What StackSpend tracks
- Real-time API costs across all models in your organization
- Model-level usage breakdown — input tokens, output tokens, and cost per model
- Claude Code user-level cost attribution — see spend per engineer
- Claude Code token and productivity metrics
- Full historical data synced on first connection
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 wrong key type will fail silently.
Verify sync
Cost data appears within minutes of saving. Your full billing history is backfilled on the first sync. Claude Code analytics (user attribution, token and productivity metrics) may lag by up to 1 hour.
Data summary
| Attribute | Value |
|---|---|
| Data latency | Real-time |
| Historical data | Full history |
| 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. Only Admin API keys have permission to read billing data.Frequently asked questions
What credential does StackSpend need to connect Anthropic?
StackSpend needs a read-only Anthropic Admin API key (sk-ant-admin), created under Settings → Admin API Keys. A regular API key (sk-ant-api) does not have access to billing data and will fail silently.
Is the connection read-only?
Yes. StackSpend only reads billing and usage data through the Anthropic Admin API and never writes to your account. It breaks spend down per model (Haiku, Sonnet, Opus) at the token level.
How long does setup take and how much history loads?
Setup takes about 2 minutes. Your full billing history is backfilled on the first sync, then StackSpend keeps costs current in real time as new usage accrues.
Why don't I see any cost data yet?
Cost data usually appears within minutes of saving. 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 such as user attribution may lag by up to 1 hour.