From 1de2e4ce2827ed71f8ff4c5991f8bd84eee8a421 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 26 Jun 2025 10:47:37 -0700 Subject: [PATCH] fix(anthropic_endpoints.py): publicly expose anthropic v1/messages endpoint --- litellm/proxy/anthropic_endpoints/endpoints.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/litellm/proxy/anthropic_endpoints/endpoints.py b/litellm/proxy/anthropic_endpoints/endpoints.py index 52dc01a86b..8af9e4d1c1 100644 --- a/litellm/proxy/anthropic_endpoints/endpoints.py +++ b/litellm/proxy/anthropic_endpoints/endpoints.py @@ -19,11 +19,11 @@ from litellm.proxy.litellm_pre_call_utils import add_litellm_data_to_request router = APIRouter() + @router.post( "/v1/messages", tags=["[beta] Anthropic `/v1/messages`"], dependencies=[Depends(user_api_key_auth)], - include_in_schema=False, ) async def anthropic_response( # noqa: PLR0915 fastapi_response: Response, @@ -167,11 +167,13 @@ async def anthropic_response( # noqa: PLR0915 if ( "stream" in data and data["stream"] is True ): # use generate_responses to stream responses - selected_data_generator = ProxyBaseLLMRequestProcessing.async_sse_data_generator( - response=response, - user_api_key_dict=user_api_key_dict, - request_data=data, - proxy_logging_obj=proxy_logging_obj, + selected_data_generator = ( + ProxyBaseLLMRequestProcessing.async_sse_data_generator( + response=response, + user_api_key_dict=user_api_key_dict, + request_data=data, + proxy_logging_obj=proxy_logging_obj, + ) ) return await create_streaming_response(