Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions litellm/model_prices_and_context_window_backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -24419,6 +24419,31 @@
"supports_tool_choice": true,
"supports_function_calling": true
},
"openrouter/qwen/qwen3-235b-a22b-2507": {
"input_cost_per_token": 7.1e-08,
"litellm_provider": "openrouter",
"max_input_tokens": 262144,
"max_output_tokens": 262144,
"max_tokens": 262144,
"mode": "chat",
"output_cost_per_token": 1e-07,
"source": "https://openrouter.ai/qwen/qwen3-235b-a22b-2507",
"supports_function_calling": true,
"supports_tool_choice": true
},
"openrouter/qwen/qwen3-235b-a22b-thinking-2507": {
"input_cost_per_token": 1.1e-07,
"litellm_provider": "openrouter",
"max_input_tokens": 262144,
"max_output_tokens": 262144,
"max_tokens": 262144,
"mode": "chat",
"output_cost_per_token": 6e-07,
"source": "https://openrouter.ai/qwen/qwen3-235b-a22b-thinking-2507",
"supports_function_calling": true,
"supports_reasoning": true,
"supports_tool_choice": true
},
"openrouter/switchpoint/router": {
"input_cost_per_token": 8.5e-07,
"litellm_provider": "openrouter",
Expand Down
17 changes: 17 additions & 0 deletions litellm/proxy/anthropic_endpoints/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ async def anthropic_response( # noqa: PLR0915

# Create Anthropic-formatted response with violation message
import uuid

from litellm.types.utils import AnthropicMessagesResponse

_anthropic_response = AnthropicMessagesResponse(
Expand Down Expand Up @@ -240,3 +241,19 @@ async def count_tokens(
raise HTTPException(
status_code=500, detail={"error": f"Internal server error: {str(e)}"}
)


@router.post(
"/api/event_logging/batch",
tags=["[beta] Anthropic Event Logging"],
)
async def event_logging_batch(
request: Request,
):
"""
Stubbed endpoint for Anthropic event logging batch requests.

This endpoint accepts event logging requests but does nothing with them.
It exists to prevent 404 errors from Claude Code clients that send telemetry.
"""
return {"status": "ok"}
1 change: 1 addition & 0 deletions litellm/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ class ProxyConfig:

def __init__(self) -> None:
self.config: Dict[str, Any] = {}
self._last_semantic_filter_config: Optional[Dict[str, Any]] = None

def is_yaml(self, config_file_path: str) -> bool:
if not os.path.isfile(config_file_path):
Expand Down
20 changes: 20 additions & 0 deletions tests/test_litellm/proxy/anthropic_endpoints/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from unittest.mock import AsyncMock, MagicMock, patch

import pytest
from fastapi.testclient import TestClient

from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing

Expand Down Expand Up @@ -66,3 +67,22 @@ async def test_async_data_generator_anthropic_dict_handling(self, mock_safe_dump
assert (
mock_safe_dumps.call_count == 2
) # Called twice, once for each dict object


class TestEventLoggingBatchEndpoint:
"""Test the stubbed event logging batch endpoint"""

def test_event_logging_batch_endpoint_exists(self):
"""Test that the event_logging_batch endpoint exists and returns 200"""
from fastapi import FastAPI

from litellm.proxy.anthropic_endpoints.endpoints import router

app = FastAPI()
app.include_router(router)

client = TestClient(app)
response = client.post("/api/event_logging/batch", json={"events": []})

assert response.status_code == 200
assert response.json() == {"status": "ok"}
Loading