Overview
Track costs and monitor usage for Anthropic’s Claude API by routing your requests through LLM Ops. This guide shows you how to integrate using Python, JavaScript, or cURL.Security Guarantee: LLM Ops does not store your API keys, request prompts, or response content in the analytics database—only metadata needed for cost analytics. The proxy must forward request bodies to Anthropic to complete the call; optional operational logging may exist in your deployment environment.
Quick Start
Point the Anthropic SDK at the LLM Ops API host (do not append/v1—the SDK adds /v1/messages itself). For raw HTTP (cURL), use the full path https://api.llm-ops.cloudidr.com/v1/messages.
- Original API host:
https://api.anthropic.com - LLM Ops API host (SDK
base_url/baseURL):https://api.llm-ops.cloudidr.com - cURL URL:
https://api.llm-ops.cloudidr.com/v1/messages
API Keys
You’ll need two credentials:- Anthropic API Key - Your Claude API key from console.anthropic.com
- Cloudidr Key - Your tracking token from the LLM Ops dashboard (tokens are typically prefixed with
trk_)
Integration Examples
- Python
- JavaScript
- cURL
Cost Tracking Headers
Add these headers to organize your costs by department, team, or agent:Supported Models
All Anthropic Claude models are supported. See the Supported Models page for the complete list of available models and pricing.What Gets Tracked
LLM Ops automatically captures: ✅ Token usage - Input and output tokens✅ Cost - Real-time cost calculation
✅ Latency - Request duration
✅ Model - Which Claude model was used
✅ Metadata - Department, team, agent
✅ Errors - Failed requests and error types
View Your Data
After making requests, view your costs in the LLM Ops Dashboard:- Agent Explorer - See costs by agent/application
- Department Breakdown - Compare department spending
- Team Analysis - Track team-level costs
- Model Comparison - Compare costs across models
- Time Series - Track spending over time
Migration from Direct API
Switching from direct Anthropic API to LLM Ops is a two-line change:Troubleshooting
Requests not being tracked
Requests not being tracked
Check these common issues:
- ✅ For SDKs, set
base_url/baseURLtohttps://api.llm-ops.cloudidr.com(do not include/v1; the SDK adds/v1/messages). - ✅ For cURL, call
https://api.llm-ops.cloudidr.com/v1/messages. - ✅ Confirm
X-Cloudidr-Keyis included on every request (or inextra_headers/ per-requestheaderswhere applicable). - ✅ Check that your Anthropic API key is valid.
Authentication errors
Authentication errors
Two separate keys are needed:
- Your Anthropic API key (for Claude access)
- Your Cloudidr tracking token (for cost tracking)
Cost data not appearing
Cost data not appearing
Wait a few moments:
- Cost data may take 10-30 seconds to appear in dashboard
- Check the correct time range in dashboard filters
- Verify requests are returning 200 OK status
Next Steps
View Dashboard
See your Claude API costs in real-time
Supported Models
View all supported Claude models
OpenAI Integration
Add cost tracking for GPT models
Set Budgets
Configure spending alerts and limits

