# CostHQ ## Docs - [CostHQ Session Data Storage: SQLite, Paths & Export](https://costhq.mintlify.app/configuration/data-storage.md): CostHQ stores all session data in a local SQLite file at ~/.costhq/sessions.db. No cloud sync, no telemetry. Learn to back up, export, and reset your data. - [Enterprise Audit Trail & SOC2 Compliance](https://costhq.mintlify.app/configuration/enterprise.md): SOC2 compliance for AI agents. Tamper-evident audit logging for LLM usage with chained SHA-256 checksums and team identity tagging. - [Built-In Model Pricing and Custom Pricing in CostHQ](https://costhq.mintlify.app/configuration/pricing.md): CostHQ ships with built-in pricing for 42+ models. Override per-model prices with cs pricing set, or add fine-tuned model pricing namespaced by provider. - [CostHQ Pro: Spend Firewall, Alerts & Advanced Analytics](https://costhq.mintlify.app/configuration/pro-license.md): CostHQ Pro provides an AI Spend Firewall, SOC2 compliance audit logs, LLM cost analytics, and runaway agent alerts to manage AI budget across your team. - [Configure Budget Alerts and Spend Limits in CostHQ](https://costhq.mintlify.app/dashboard/budget-alerts.md): Set per-session and daily cost limits with cs budget. The Alerts page tracks spend with live progress bars and fires browser notifications on breach. - [CostHQ Web Dashboard: Sessions, Costs, and Analytics](https://costhq.mintlify.app/dashboard/overview.md): The CostHQ dashboard runs at localhost:3737. View session history, AI cost trends, model breakdowns, file hotspots, activity heatmaps, and pricing tables. - [Install CostHQ CLI and Node.js Package](https://costhq.mintlify.app/installation.md): Install CostHQ globally with npm. Includes build tool requirements for SQLite, binary list, and platform-specific setup for macOS, Linux, and Windows. - [Automatic Claude Code Cost Tracking with CostHQ Hooks](https://costhq.mintlify.app/integrations/claude-code.md): Track Claude Code API costs automatically. Configure hooks to start sessions, monitor LLM token spend, and calculate AI usage costs without changing your workflow. - [Integrate CostHQ with Any Custom AI Agent Framework](https://costhq.mintlify.app/integrations/custom-agents.md): Track any Python, Node.js, or shell-based agent with CostHQ using cs run, environment variable proxy configuration, CI/CD hooks, or git post-commit hooks. - [Track OpenClaw Agent Runs Automatically with CostHQ](https://costhq.mintlify.app/integrations/openclaw.md): Install the CostHQ skill to auto-track every OpenClaw run — session start, AI calls, cost logging, and session end without any manual steps. - [Introduction to CostHQ](https://costhq.mintlify.app/introduction.md): Discover how CostHQ enables transparent AI agent cost tracking and LLM spend monitoring for developers and teams using Claude Code, OpenAI, or local models. - [Track Your First AI Agent Session with CostHQ](https://costhq.mintlify.app/quickstart.md): Start tracking AI agent costs in under two minutes. Run cs run to wrap any command, or cs start/cs end for manual sessions with full cost summaries. - [AgentSession: Programmatic Session API for Node.js](https://costhq.mintlify.app/reference/agent-session.md): The AgentSession class from costhq/agents provides budget enforcement, file watching, git tracking, and callback hooks for Node.js agent frameworks. - [CostHQ CLI Reference: All cs Commands and Global Flags](https://costhq.mintlify.app/reference/cli-overview.md): Complete command list for the CostHQ cs CLI. All commands support --json for machine-readable output and exit code 0 on success, 1 on error. - [CostHQ CLI Error Codes and Exit Code Reference](https://costhq.mintlify.app/reference/error-codes.md): CostHQ always exits with code 1 on error, even in --json mode. Parse error.code programmatically — never string-compare error.message. - [cs export and cs stats: Export Data and View Totals](https://costhq.mintlify.app/reference/export-stats.md): Use cs export to download session data as JSON or CSV, and cs stats to view aggregate metrics across all sessions including total cost, time, and tokens. - [Drop-In SDK Extensions: TrackedOpenAI and TrackedAnthropic](https://costhq.mintlify.app/reference/extensions.md): Replace new OpenAI() with new TrackedOpenAI() for automatic token and cost logging. TrackedAnthropic and TrackedGoogleAI work identically. - [JSON Output Schema for CostHQ CLI Commands](https://costhq.mintlify.app/reference/json-output.md): Every cs command supports --json for machine-readable output. All responses include schemaVersion and CostHQVersion fields for forward compatibility. - [cs log-ai: Log AI Token Usage and Costs to a Session](https://costhq.mintlify.app/reference/log-ai.md): cs log-ai records AI provider, model, and token counts to the active session. Cost is auto-calculated for 42+ known models; provide -c for others. - [Middleware Hooks: withTracking, BatchTracker, createTrackedClient](https://costhq.mintlify.app/reference/middleware.md): costhq/middleware exports withTracking, BatchTracker, and createTrackedClient to wrap any async AI function or existing client with automatic cost tracking. - [Session Commands: start, end, status, show, list, stats](https://costhq.mintlify.app/reference/session-commands.md): Reference for cs start, cs end, cs status, cs show, cs list, cs stats, cs note, and cs recover — the core session lifecycle commands in CostHQ. - [cs run: Automatic Zero-Config Agent Session Tracking](https://costhq.mintlify.app/tracking/cs-run.md): cs run wraps any command with a full session lifecycle: starts a session, spins up the local proxy, runs your command, and prints a cost summary on exit. - [Local Model Tracking: Ollama, llama.cpp, vLLM, LM Studio](https://costhq.mintlify.app/tracking/local-models.md): Monitor Ollama compute tracking and local AI GPU costs. Register self-hosted LLMs with a $/hr GPU rate and track usage for vLLM, llama.cpp, and LM Studio. - [Manual Session Tracking with cs start and cs end Commands](https://costhq.mintlify.app/tracking/manual.md): Use cs start and cs end to manually control session boundaries for longer work periods. Combine with cs log-ai to record AI usage from any provider. - [CostHQ Local Proxy for Automatic API Cost Tracking](https://costhq.mintlify.app/tracking/proxy.md): cs proxy start runs a local HTTP proxy at port 3739 that intercepts Anthropic and OpenAI API calls and logs them to the active session automatically. - [Troubleshooting & Common Issues](https://costhq.mintlify.app/troubleshooting.md): Solutions to common errors, proxy issues, and missing costs when using CostHQ.