Tracking Claude Code and Codex costs with Kong AI Cost Management
The author explains how to use Kong AI Cost Management, a feature of Kong Konnect released in November 2026, to track the costs of Claude Code and Codex. It records a usage event for each request that passes through Kong AI Gateway[1], assigns the usage to users or teams, prices it, and shows it on a dashboard. Its features include a Dashboard, an Explorer, Budgets with email or Slack alerts, and exports in CSV or Parquet.
The setup has six steps: identify users with an Auth Strategy and Virtual Keys[2], set prices in the Price Catalog[3], enable tag ingestion in the data plane, turn on Attribution[4] for Claude Code and Codex, send extra tags with ai-cost- headers, and configure Budgets with notifications. The author ran the setup on a self-hosted AI Gateway 2.3 data plane in Docker, using Claude and GPT models on Microsoft Foundry. According to the author, the tool can be told apart from the User-Agent header without extra configuration.
Sources
-
JPZenn JA
Claude Code / CodexのコストをKong AI Cost Managementで見るためにやること






