litellm/docs/my-website/docs/proxy/credential_usage_tracking.md
yuneng-jiang 7daeaf8106 [Docs] Add Credential Usage Tracking documentation
Add new document explaining automatic credential usage tracking and tagging. When models use reusable credentials, LiteLLM automatically injects a Credential: <name> tag on requests, enabling credential-level spend tracking on the Usage page with no additional configuration.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-25 10:52:24 -08:00

1.2 KiB

Credential Usage Tracking

When a model is attached to a reusable credential, LiteLLM automatically injects the credential name as a tag on every request that uses that model. This means credential-level spend and usage are tracked with zero extra configuration.

How It Works

When you attach a model to a reusable credential via litellm_credential_name, each request routed through that model is tagged Credential: <name> (for example, Credential: xAI). This tag flows into DailyTagSpend and appears in the Tag view on the Usage page, where you can filter spend and usage by credential.

If a model has no credential attached, behavior is unchanged—no credential tag is added.

Viewing Credential Usage

In the Admin UI, go to Usage → Tag and look for tags with the Credential: prefix. These represent aggregated spend and token usage across all requests that used that credential.