diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index 9de32ac50d..264964a940 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -329,6 +329,42 @@ export const userInfoCall = async ( } }; + +export const teamInfoCall = async ( + accessToken: String, + teamID: String | null, +) => { + try { + let url = proxyBaseUrl ? `${proxyBaseUrl}/team/info` : `/team/info`; + if (teamID) { + url = `${url}?team_id=${teamID}`; + } + console.log("in teamInfoCall"); + const response = await fetch(url, { + method: "GET", + headers: { + Authorization: `Bearer ${accessToken}`, + "Content-Type": "application/json", + }, + }); + + if (!response.ok) { + const errorData = await response.text(); + message.error(errorData, 20); + throw new Error("Network response was not ok"); + } + + const data = await response.json(); + console.log("API Response:", data); + return data; + // Handle success - you might want to update some state or UI based on the created key + } catch (error) { + console.error("Failed to create key:", error); + throw error; + } +}; + + export const getTotalSpendCall = async ( accessToken: String, ) => {