Skip to main content

Billable Request Metering

LiteLLM Enterprise pricing is usage-based. Billable request metering reports that usage. The proxy counts successful requests to LLM, MCP, and A2A endpoints. It sends one OpenTelemetry counter to LiteLLM's collector. It authenticates with your deployment's OAuth client ID and secret.

Metering sends request counts with the endpoint category, route, status, model ID, LiteLLM version, and license ID when available. Prompts, responses, and virtual keys never leave the deployment. The gateway sends the license key to the LiteLLM license server only if its offline signature check fails. See Activate your license. Metering runs separately from your OTEL logging and metrics pipeline.

info

Get a LITELLM_LICENSE, OAuth client ID, and OAuth client secret during LiteLLM onboarding. Contact us if you need these credentials.

These OAuth settings replace the certificate settings from earlier builds. Use an image containing the OAuth metering implementation.

Quick Start​

1. Set environment variables​

VariableRequiredDescription
LITELLM_BILLING_METRICS_ENDPOINTYesCollector URL. Use https://telemetry.litellm.ai
LITELLM_BILLING_METRICS_CLIENT_IDYesOAuth client ID from LiteLLM onboarding
LITELLM_BILLING_METRICS_CLIENT_SECRETYesOAuth client secret from your secret manager
LITELLM_BILLING_METRICS_TOKEN_URLYesHTTPS OAuth token endpoint from onboarding
LITELLM_BILLING_METRICS_EXPORT_INTERVAL_MSNoPush interval in milliseconds. Default 60000
export LITELLM_BILLING_METRICS_ENDPOINT="https://telemetry.litellm.ai"
export LITELLM_BILLING_METRICS_TOKEN_URL="https://litellm-prod.auth.us-west-1.amazoncognito.com/oauth2/token"

Inject LITELLM_LICENSE, LITELLM_BILLING_METRICS_CLIENT_ID, and LITELLM_BILLING_METRICS_CLIENT_SECRET through your secret manager. The exporter obtains a bearer token with the OAuth client-credentials flow. Both URLs must use HTTPS.

2. Start the proxy​

litellm --config config.yaml

3. Verify​

The line below is logged at INFO level, so it only shows when the proxy runs with LITELLM_LOG=INFO (or --detailed_debug). Send a request through the proxy, then check the logs for:

Enterprise billing metrics enabled: exporting to https://telemetry.litellm.ai every 60000 ms

If this line is missing, look for a warning naming the misconfigured variable. Invalid startup configuration disables metering. The proxy continues to serve requests if metering fails.

Deploy​

The LiteLLM chart has one billingMetrics block for both deployment modes. Create a Secret named litellm-billing-metrics with client-id and client-secret keys through your secret manager. Then enable metering:

values.yaml
billingMetrics:
enabled: true
secretName: litellm-billing-metrics
ValueDefaultDescription
billingMetrics.enabledfalseEnable metering
billingMetrics.endpointhttps://telemetry.litellm.aiCollector URL
billingMetrics.tokenUrlhttps://litellm-prod.auth.us-west-1.amazoncognito.com/oauth2/tokenOAuth token endpoint
billingMetrics.secretNamelitellm-billing-metricsSecret with client-id and client-secret
billingMetrics.exportIntervalMs""Push interval. The proxy defaults to 60000

What counts as billable​

A request counts when it returns a 2xx status on an LLM inference endpoint (chat completions, embeddings, responses, images, audio, and the other inference routes), the MCP transport, or the A2A message/send route. GET reads, management endpoints, health probes, and failed requests do not count.

The count lines up with the successful requests number on the Admin UI usage page.

FAQ​

Does this affect proxy performance? No meaningful impact at the default settings. The per-request cost is about 1.6 microseconds.

What if the collector is unreachable? Requests are unaffected. The counter is cumulative, so counts recorded during an outage are included in the next successful export.

What happens on restart? The proxy attempts a final flush on graceful shutdown. A crash or failed flush can lose counts before the proxy exports them.

Air-gapped deployments? Metering needs outbound HTTPS to the collector and OAuth token endpoint. If your deployment cannot reach it, talk to us during onboarding.

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →