diff --git a/docs/my-website/docs/tutorials/cost_tracking_coding.md b/docs/my-website/docs/tutorials/cost_tracking_coding.md index ae0c30070a..ffad2d45c8 100644 --- a/docs/my-website/docs/tutorials/cost_tracking_coding.md +++ b/docs/my-website/docs/tutorials/cost_tracking_coding.md @@ -4,9 +4,9 @@ import Image from '@theme/IdealImage'; # Track Usage for Coding Tools -This tutorial shows how to track usage and costs for AI-powered coding tools like Claude Code, Roo Code, Gemini CLI, and OpenAI Codex through LiteLLM. +Track usage and costs for AI-powered coding tools like Claude Code, Roo Code, Gemini CLI, and OpenAI Codex through LiteLLM. -Track requests, total costs, and user engagement metrics for each coding tool via User-Agent headers. +Monitor requests, costs, and user engagement metrics for each coding tool using User-Agent headers. +View total cost and successful requests for each coding tool. +#### Daily, Weekly, and Monthly Active Users -#### DAU, WAU, MAU - -This shows the daily, weekly, and monthly active users for each coding tool. - -
+View active user metrics for each coding tool. - - ## How LiteLLM Identifies Coding Tools LiteLLM tracks coding tools by monitoring the `User-Agent` header in incoming API requests (`/chat/completions`, `/responses`, etc.). Each unique User-Agent is tracked separately for usage analytics. ### Example Request -Here's an example using `claude-cli` as the User-Agent: +Example using `claude-cli` as the User-Agent: ```shell curl -X POST \ --H "Content-Type: application/json" \ --H "Authorization: Bearer sk-1234" \ --H "User-Agent: claude-cli/1.0" \ --d '{"model": "claude-3-5-sonnet-latest", "messages": [{"role": "user", "content": "Hello, how are you?"}]}' \ -http://localhost:4000/chat/completions + -H "Content-Type: application/json" \ + -H "Authorization: Bearer sk-1234" \ + -H "User-Agent: claude-cli/1.0" \ + -d '{"model": "claude-3-5-sonnet-latest", "messages": [{"role": "user", "content": "Hello, how are you?"}]}' \ + http://localhost:4000/chat/completions ```