18 views
-/https://github.com/berriai/litellm/issues/18058
GitHub Ā· issue

#18058 [Bug]: Cost calculation in LiteLLM proxy not working for ElevenLabs model

  • State: open
  • Author: @Dobiasd
  • Labels: bug, proxy, llm translation

### What happened?

Here is a minimal example to reproduce the problem:

`litellm_config.yaml`:

```yaml model_list: - model_name: elevenlabs-eleven-multilingual-v2 litellm_params: model: elevenlabs/eleven_multilingual_v2 api_key: ... general_settings: master_key: sk-1234 litellm_settings: callbacks: custom_callbacks.proxy_handler_instance ```

`custom_callbacks.py`:

```python import litellm from litellm.integrations.custom_logger import CustomLogger

class MyCustomHandler(CustomLogger): async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): cost_in_usd = litellm.completion_cost(completion_response=response_obj) print(cost_in_usd)

proxy_handler_instance = MyCustomHandler() ```

Run the proxy:

```bash docker run \ -v $(pwd)/litellm_config.yaml:/app/config.yaml \ -v $(pwd)/custom_callbacks.py:/app/custom_callbacks.py \ -p 4000:4000 \ ghcr.io/berriai/litellm:v1.80.10.rc.2 \ --config /app/config.yaml ```

Python script to send a request:

```python from openai import OpenAI

client = OpenAI(api_key="sk-1234", base_url="http://0.0.0.0:4000")

response = client.audio.speech.create( model="e…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 Ā· 31d18h25m55s ago — entered Ā· #import:https:::github.com:berriai:litellm post #2624
The right-side issue is harder because it spans security-sensitive authentication state, persistence and cache consistency, expiration semantics, and regression coverage. The left-side issue is comparatively narrower provider-specific accounting work.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search