Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(claude-code): use Annotated dependency style to stay within B008 lint budget

ozolam168ee2d9fdbd
diff --git a/litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py b/litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py
index 4730372511a..09ba2c93ea0 100644
--- a/litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py
+++ b/litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py
@@ -6,21 +6,21 @@ Plugins are stored as metadata + git source references in LiteLLM database.
Actual plugin files are hosted on GitHub/GitLab/Bitbucket.
Endpoints:
-/claude-code/marketplace.json - GET - List plugins for Claude Code discovery
-/claude-code/plugins - POST - Register a new plugin (create-only)
-/claude-code/plugins - GET - List plugins (admin)
-/claude-code/plugins/{name} - GET - Get plugin details
-/claude-code/plugins/{name} - PUT - Update an existing plugin
-/claude-code/plugins/{name}/enable - POST - Enable a plugin
-/claude-code/plugins/{name}/disable - POST - Disable a plugin
-/claude-code/plugins/{name} - DELETE - Delete a plugin
+/claude-code/marketplace.json - GET - List plugins for Claude Code discovery (unauthenticated)
+/claude-code/plugins - POST - Register a new plugin (create-only, proxy admin only)
+/claude-code/plugins - GET - List plugins (any authenticated key)
+/claude-code/plugins/{name} - GET - Get plugin details (any authenticated key)
+/claude-code/plugins/{name} - PUT - Update an existing plugin (proxy admin only)
+/claude-code/plugins/{name}/enable - POST - Enable a plugin (proxy admin only)
+/claude-code/plugins/{name}/disable - POST - Disable a plugin (proxy admin only)
+/claude-code/plugins/{name} - DELETE - Delete a plugin (proxy admin only)
"""
import json
import re
from collections.abc import Mapping, Sequence
from datetime import datetime, timezone
-from typing import Final, Protocol, TypedDict
+from typing import Annotated, Final, Protocol, TypedDict
from fastapi import APIRouter, Depends, HTTPException
from fastapi.responses import JSONResponse
@@ -255,6 +255,8 @@ async def register_plugin(
the same name already exists it returns 409 Conflict; use
PUT /claude-code/plugins/{plugin_name} to update an existing plugin.
+ Requires a proxy admin API key.
+
Parameters:
- name: Plugin name (kebab-case)
- source: Git source reference (github, url, or git-subdir format)
@@ -483,7 +485,7 @@ async def get_plugin(
async def update_plugin(
plugin_name: str,
request: UpdatePluginRequest,
- user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
+ user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],
):
"""
Update an existing plugin in the LiteLLM marketplace.
@@ -497,6 +499,8 @@ async def update_plugin(
Returns 404 if no plugin with the given name exists; use
POST /claude-code/plugins to create a new plugin.
+ Requires a proxy admin API key.
+
Parameters:
- plugin_name: Name of the plugin to update (path parameter)
- source: Git source reference (github, url, or git-subdir format)
@@ -584,6 +588,8 @@ async def enable_plugin(
"""
Enable a disabled plugin.
+ Requires a proxy admin API key.
+
Parameters:
- plugin_name: The name of the plugin to enable
"""
@@ -631,6 +637,8 @@ async def disable_plugin(
"""
Disable a plugin without deleting it.
+ Requires a proxy admin API key.
+
Parameters:
- plugin_name: The name of the plugin to disable
"""
@@ -678,6 +686,8 @@ async def delete_plugin(
"""
Delete a plugin from the marketplace.
+ Requires a proxy admin API key.
+
Parameters:
- plugin_name: The name of the plugin to delete
"""