diff --git a/src/agents-api/agents_api/clients/litellm.py b/src/agents-api/agents_api/clients/litellm.py index c9bc89042..58b71e7c4 100644 --- a/src/agents-api/agents_api/clients/litellm.py +++ b/src/agents-api/agents_api/clients/litellm.py @@ -76,7 +76,7 @@ async def acompletion( ) custom_api_key = secret and secret.value - model = f"openai/{model}" # This is needed for litellm + model = f"openai/{model.removeprefix('openai/')}" # This is needed for litellm supported_params: list[str] = ( get_supported_openai_params(model) or [] @@ -136,9 +136,8 @@ async def aembedding( custom_api_key: str | None = None, **settings, ) -> list[list[float]]: - if not custom_api_key: - model = f"openai/{model}" # This is needed for litellm + model = f"openai/{model.removeprefix('openai/')}" # This is needed for litellm input = ( [inputs] if isinstance(inputs, str)