diff --git a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx index b04d2e93aa1..1c7a07f1fd5 100644 --- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx @@ -18,6 +18,7 @@ import { keyCreateServiceAccountCall, fetchMCPAccessGroups, getPromptsList, + getPassThroughEndpointsCall, } from "../networking"; import VectorStoreSelector from "../vector_store_management/VectorStoreSelector"; import { Team } from "../key_team_helpers/key_list"; @@ -159,6 +160,7 @@ const CreateKey: React.FC = ({ const [predefinedTags, setPredefinedTags] = useState(getPredefinedTags(data)); const [guardrailsList, setGuardrailsList] = useState([]); const [promptsList, setPromptsList] = useState([]); + const [passThroughRoutesList, setPassThroughRoutesList] = useState([]); const [loggingSettings, setLoggingSettings] = useState([]); const [selectedCreateKeyTeam, setSelectedCreateKeyTeam] = useState(team); const [isCreateUserModalVisible, setIsCreateUserModalVisible] = useState(false); @@ -240,8 +242,19 @@ const CreateKey: React.FC = ({ } }; + const fetchPassThroughEndpoints = async () => { + try { + const response = await getPassThroughEndpointsCall(accessToken); + const passThroughPaths = response.endpoints.map((endpoint: { path: string }) => endpoint.path); + setPassThroughRoutesList(passThroughPaths); + } catch (error) { + console.error("Failed to fetch pass through endpoints:", error); + } + }; + fetchGuardrails(); fetchPrompts(); + fetchPassThroughEndpoints(); }, [accessToken]); // Fetch possible user roles when component mounts @@ -914,6 +927,40 @@ const CreateKey: React.FC = ({ options={promptsList.map((name) => ({ value: name, label: name }))} /> + + Allowed Pass Through Routes{" "} + + e.stopPropagation()} // Prevent accordion from collapsing when clicking link + > + + + + + } + name="allowed_passthrough_routes" + className="mt-4" + help={ + premiumUser + ? "Select existing pass through routes or enter new ones" + : "Premium feature - Upgrade to set pass through routes by key" + } + > +