Choose Your Integration
CostHawk supports three integration paths. Start with the one that matches your use case.Admin API Sync
Recommended start for teams. Paste provider admin keys and get org-level usage/cost visibility with no app code changes.
MCP Server
For Claude Code / Claude Desktop / Codex workflows. Keep MCP enabled for assistant-native queries and local usage operations.
Proxy + Wrapped Keys
Advanced runtime controls: swap your SDK base URL to the CostHawk proxy and use a wrapped key there.
MCP is fully supported and can run alongside Admin API or Proxy integrations.
Not Sure Which Key Goes Where?
Use the Wrapped Keys guide if you are routing provider SDK traffic. Use Authentication if you are configuring MCP or CostHawk API access.
Fastest Path: Admin API Sync
If you want visibility quickly, connect provider admin keys first:Create provider admin keys
Generate an Anthropic Admin key (
sk-ant-admin-...) and an OpenAI org admin key.Admin API Guide
Full setup details, security model, and sync behavior.
MCP Server Setup
Prerequisites
- A CostHawk account (join the waitlist if you don’t have one)
- Claude Code or Claude Desktop installed
Step 1: Browser Login (Recommended)
Run:mcp:readmcp:writeotel:ingest(same token can be reused for optional OTel)
Step 2: Restart Claude Code
After login/setup, restart Claude Code so new tools load.OpenCode (opencode.ai)
Add CostHawk to your OpenCode config at~/.config/opencode/opencode.json (or opencode.jsonc):
"COSTHAWK_AUTO_SYNC": "true" (and optionally "COSTHAWK_CODEX_AUTO_SYNC": "false" to disable Codex sync).
Prefer a guided setup? Run:
Step 3: Run Self-Test (Required)
Run:"hasApiKey": true"autoSyncEnabled": trueif you want automatic uploads"codexAutoSyncEnabled": trueif you want Codex included in auto-sync"local.codexDir": trueif Codex sessions are discoverable on this machine
local.codexDir is false and you use a custom Codex path, set COSTHAWK_CODEX_SESSIONS_DIR in MCP env.
Step 4: Start Using CostHawk
You can now ask Claude about your API costs:Usage Queries
Usage Queries
- “What’s my AI API usage this month?”
- “Show me costs broken down by provider”
- “How many tokens have I used today?”
Savings Analysis
Savings Analysis
- “Am I saving money with Claude Max?”
- “Show my savings vs retail pricing”
- “Break down my savings by model”
Alerts & Monitoring
Alerts & Monitoring
- “Are there any cost anomalies I should know about?”
- “List my unread alerts”
- “Create a Slack webhook for budget alerts”
Need Explicit Ops Checks?
Use the Operations Runbook for self-test interpretation, auto-sync behavior, and Codex troubleshooting.
Alternative: Manual Configuration
If you cannot use browser login, create a token in Settings → Developer and use manual token mode.- Claude Code
- Claude Desktop (macOS)
- Claude Desktop (Windows)
Edit
~/.claude/.mcp.json: