Resources / Integrations / LiteLLM

INTEGRATION · LITELLM

LiteLLM proxy cost tracking per feature and customer

To see LiteLLM proxy spend per feature and per customer, turn on the otel callback in your proxy config and point its exporter at LLMtrack. No SDK and no change to your application code. LiteLLM is one of several gateways LLMtrack connects to.

Setup: about 2 minutes · No SDK · Free plan: 3,000 requests a month · Checked against LiteLLM's docs on 13 Oct 2026

What you get on top of LiteLLM

LiteLLM tracks spend per key and per team. LLMtrack adds cost per product feature, margin per customer against what they pay you, a forecast with your budget day, and cache and model-switch advice.

These are the same views every LLMtrack workspace gets. See all six on the integrations overview. They're part of a complete approach to LLM cost.

Set it up

  1. 01

    Copy your LLMtrack ingest key

    Sign up free, open Keys & Integrations, and create a key named "LiteLLM". One key per connection lets you revoke it on its own.

  2. 02

    Turn on the otel callback

    In config.yaml, then set the exporter environment variables:

    litellm_settings:
      callbacks: ["otel"]
      turn_off_message_logging: true
    
    OTEL_EXPORTER="otlp_http"
    OTEL_ENDPOINT="https://otlp.llm-track.com"
    OTEL_HEADERS="Authorization=Bearer llmt_live_…"

    Installed LiteLLM with pip? Add the exporter packages too: pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http. Without them the otel callback can't start.

  3. 03

    Label your requests

    Pass the customer as the user and the feature in metadata:

    "user": "acme-corp",
    "metadata": { "feature": "summarizer" }

    Tip turn_off_message_logging: true keeps prompt text inside your proxy. Some services call providers through the LLMtrack SDK as well? Send responseId from those and every request lands once.

Check it worked

Restart the proxy, send one request, then open your LLMtrack dashboard. It appears with source "LiteLLM", under the feature you set, priced in under a second.

Troubleshooting

  • Nothing arrivesOTEL_ENDPOINT takes the base address, https://otlp.llm-track.com, without /v1/traces. The exporter adds the path itself.
  • 401 errors in the proxy logWrite the header with a plain space, inside the quotes: OTEL_HEADERS="Authorization=Bearer llmt_live_…". A header copied from another guide with Bearer%20 works too.
  • gRPC errorsUse OTEL_EXPORTER="otlp_http". LLMtrack receives OTLP over HTTP.
  • A request shows "Unpriced"That model isn't in LLMtrack's price sheet yet. It's recorded and flagged, never as $0. See the model price list.

What LLMtrack keeps from LiteLLM

LLMtrack reads only the fields below. Everything else in the trace, including any prompt or completion text, is dropped before anything is saved.

Kept

  • model and provider
  • token counts: input, output, cached, cache writes, reasoning, audio
  • the cost your gateway reported
  • your feature label and customer ID
  • latency and status

Dropped on arrival

  • prompts and system instructions
  • completions and tool calls
  • images and audio
  • anything else that holds content

Questions

Does this work with the LiteLLM Python library, not just the proxy?

Partly. With litellm.callbacks = ["otel"] and the same environment variables, the library sends the model, tokens, cost and user. As of LiteLLM 1.105 it doesn't export request metadata, so features show as "unknown". For cost per feature, run the proxy.

Can I keep my other LiteLLM callbacks?

Yes. Add "otel" to the list next to the callbacks you already use.

Do you store my prompts?

No. LLMtrack reads token counts, the model, your labels and timing. Any prompt or completion text in a trace is dropped before anything is written, and it never appears in logs.

I also send some of these calls through the LLMtrack SDK. Will they count twice?

No. Pass the provider's response ID to track() as responseId, and LLMtrack matches the two copies, keeps one row with the details from both, and counts it once. Calls that only look alike, with no ID to compare, are labelled "possible duplicate" and kept out of your totals until you decide. Hidden copies still count toward your monthly events, so sending responseId is the setup that keeps everything exact. You choose how both cases behave in Keys & Integrations.

How are events counted?

One request your gateway exports is one event. The free plan includes 3,000 a month, and Pro includes 25,000 for $11.99. Your usage page shows which connection used them, so a busy gateway is never a mystery.

Other gateways

See every integration on one page

Keep LiteLLM. See where the money goes.

One URL in your LiteLLM settings, and your next request shows up on your dashboard already priced.