# Cost Analysis

This page shows how to track LLM cost using APIs.

## Callback Manager

The callback manager is a class that manages the callback functions.

You can register `llm-start`, `llm-end`, and `llm-stream` callbacks to the callback manager for tracking the cost.

import CodeBlock from "@theme/CodeBlock";
import CodeSource from "!raw-loader!../../../../examples/recipes/cost-analysis";

<CodeBlock language="ts">{CodeSource}</CodeBlock>
