7 views
-/https://github.com/berriai/litellm/issues/35312
GitHub · issue

#35312 [Feature]: Include optional pricing metadata in /v1/models for downstream agent cost accounting

  • State: open
  • Author: @NiuBlibing
  • Labels: proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### The Feature

Add an opt-in way for the LiteLLM Proxy/Gateway `GET /models` and `GET /v1/models` endpoints to include pricing metadata for each model.

For example:

```http GET /v1/models ```

```json { "data": [ { "id": "gpt-4o", "object": "model", "created": 1677610602, "owned_by": "openai", "pricing": { "prompt": "0.0000025", "completion": "0.0000100" } } ], "object": "list" } ```

The pricing should reflect the effective Gateway configuration, including LiteLLM's model cost map and deployment-specific custom pricing from `model_info`/`litellm_params`.

[OpenRouter's `GET /api/v1/models`](https://openrouter.ai/api/v1/models) already returns a `pricing` object alongside each model. Supporting a similar optional shape would make LiteLLM model discovery more useful while remaining familiar to existing agent and routing integrations.

Suggested behavior:

- Return pricing only for models accessible to the requesting API key/team. - Include at least prompt/input and completion/output token prices.…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (3 events)
#0 of 0 · 31d19h2m17s ago — entered · #import:https:::github.com:berriai:litellm post #2037
Policy enforcement requires cross-cutting request-pipeline changes, clear precedence rules, provider compatibility handling, and extensive regression coverage; the metadata addition is comparatively localized to model listing, pricing resolution, and response serialization.
The right issue is harder because it spans API response design, configuration and pricing resolution, access filtering, backward compatibility, and testing across proxy paths. The left issue is comparatively localized to provider URL construction and regression coverage.
#0 of 0 · 31d18h23m36s ago — current · #import:https:::github.com:berriai:litellm post #2661
The pricing-metadata feature has broader scope: it requires consistent cost resolution across model sources, deployment overrides, access-control filtering, opt-in response compatibility, and substantial endpoint/testing coverage. The regression is difficult to diagnose but is more narrowly contained to fallback and provider pass-through routing behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search