Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

You can route AI requests through a self-hosted proxy and monitor their activity without paying for a separate proxy service. With LiteLLM, a database-free setup can show endpoint activity, but it does not provide the same per-key spend attribution or enforceable budget caps as a PostgreSQL-backed setup. The right configuration depends on whether you need to see that requests happened or attribute calculated spend to applications, users, or teams.

What a server proxy can track

LiteLLM describes its proxy as a self-hosted, OpenAI-compatible gateway: your application sends compatible requests to the proxy, which routes them to configured model providers. That gives you one place to route requests and inspect gateway activity. See LiteLLM’s Getting Started guide.

“Token tracking” can mean two different things. Endpoint activity reports request events at the gateway. Spend tracking records and attributes calculated costs for completed requests. Neither should automatically be treated as an exact provider invoice: compare proxy-reported spend with provider billing when you need accounting accuracy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the deployment that matches your tracking needs

Deployment What it supports What it does not provide
Basic Docker proxy without a database Request routing and endpoint-level activity. Virtual keys and spend tracking; configured max_budget does not enforce an actual spend cap on this database-less path.
Proxy connected to PostgreSQL Virtual keys and spend attribution by key, user, and team; database-backed budgets. Guaranteed reconciliation with provider invoices.

LiteLLM’s Docker quickstart demonstrates the basic database-free route. Its Virtual Keys and Budgets and Rate Limits documentation cover the database-backed features.

Set up a basic proxy for endpoint activity

  1. Use the LiteLLM Docker quickstart to start the proxy and configure the model provider or providers you intend to use. A separate host machine is optional; the documentation describes self-hosted Docker deployment but does not set out minimum hardware requirements.

  2. Point an OpenAI-compatible client at the proxy endpoint instead of sending requests directly to a provider. Configure the client with the proxy connection details and credentials required by your deployment.

  3. Open LiteLLM’s Admin UI and inspect endpoint analytics. LiteLLM says endpoint activity is automatically recorded and visualized there; consult Endpoint Activity for the documented analytics.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This setup is useful for observing gateway-level request activity. It is not a substitute for per-application or per-user spend attribution when those distinctions matter.

Add per-key spend attribution with PostgreSQL

  1. Connect the proxy to PostgreSQL and configure its master key as described in LiteLLM’s Virtual Keys guide.

  2. Create virtual keys and assign them to the applications, users, or teams you want to distinguish. Use separate keys where that separation matches your operations and reporting needs.

  3. Review spend tracking for those attribution dimensions. LiteLLM calculates recorded spend using its model cost function; treat that as proxy-calculated spend, not as a provider’s final bill.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Custom tags can add workflow or project context to spend records. LiteLLM documents a custom-tag workflow that uses virtual keys and a database. Its cost-tracking documentation says User-Agent is tracked by default in the described setup unless disabled. See Spend Tracking.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Read activity and spend reports as different measurements

Do not expect endpoint request counts and spend records to match one-for-one. Endpoint activity is gateway-level; its counts can include requests that fail before a key or model is resolved. Spend rollups are based on logged requests after completion and support attribution by key, model, provider, or tag. Because the two datasets have different inclusion rules, a mismatch does not by itself show that tracking is broken. LiteLLM explains the distinction in its Endpoint Activity documentation.

Do not use a database-free budget as a hard cap

A database-less proxy cannot load a spend total for budget enforcement, so setting max_budget on that deployment does not cap actual provider spend. LiteLLM documents the fail-open behavior in its Quickstart and Budgets and Rate Limits guidance. If a hard limit matters, use a database-backed configuration and verify its behavior, or set spending limits with the provider. Keep provider credentials secure and maintain the proxy and PostgreSQL instance.

Which setup should you use?

  • Choose the basic proxy if you want centralized routing and visibility into endpoint activity, and do not need spend attributed to particular keys or enforceable proxy budgets.
  • Choose PostgreSQL-backed tracking if you need separate spend reporting for applications, users, or teams, or want database-backed budget controls.
  • Check provider billing as well if the figures will be used for accounting or financial decisions; the documentation reviewed does not establish exact reconciliation guarantees.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.