UNPKG

@cotofe/service-of-litellm

Version:

OpenAPI client for @cotofe/service-of-litellm

653 lines 50.4 kB
"use strict";
/**
 * Platform
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TeamManagementApi = void 0;
const runtime = require("../runtime");
/**
 *
 */
class TeamManagementApi extends runtime.BaseAPI {
    /**
     * Add a success/failure callback to a team  Use this if if you want different teams to have different success/failure callbacks  Parameters: - callback_name (Literal[\"langfuse\", \"langsmith\", \"gcs\"], required): The name of the callback to add - callback_type (Literal[\"success\", \"failure\", \"success_and_failure\"], required): The type of callback to add. One of:     - \"success\": Callback for successful LLM calls     - \"failure\": Callback for failed LLM calls     - \"success_and_failure\": Callback for both successful and failed LLM calls - callback_vars (StandardCallbackDynamicParams, required): A dictionary of variables to pass to the callback     - langfuse_public_key: The public key for the Langfuse callback     - langfuse_secret_key: The secret key for the Langfuse callback     - langfuse_secret: The secret for the Langfuse callback     - langfuse_host: The host for the Langfuse callback     - gcs_bucket_name: The name of the GCS bucket     - gcs_path_service_account: The path to the GCS service account     - langsmith_api_key: The API key for the Langsmith callback     - langsmith_project: The project for the Langsmith callback     - langsmith_base_url: The base URL for the Langsmith callback  Example curl: ``` curl -X POST \'http:/localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback\'         -H \'Content-Type: application/json\'         -H \'Authorization: Bearer sk-1234\'         -d \'{     \"callback_name\": \"langfuse\",     \"callback_type\": \"success\",     \"callback_vars\": {\"langfuse_public_key\": \"pk-lf-xxxx1\", \"langfuse_secret_key\": \"sk-xxxxx\"}      }\' ```  This means for the team where team_id = dbe2f686-a686-4896-864a-4c3924458709, all LLM calls will be logged to langfuse using the public key pk-lf-xxxx1 and the secret key sk-xxxxx
     * Add Team Callbacks
     */
    addTeamCallbacksTeamTeamIdCallbackPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            if (requestParameters.teamId == null) {
                throw new runtime.RequiredError('teamId', 'Required parameter "teamId" was null or undefined when calling addTeamCallbacksTeamTeamIdCallbackPost().');
            }
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (requestParameters.litellmChangedBy != null) {
                headerParameters['litellm-changed-by'] = String(requestParameters.litellmChangedBy);
            }
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/{team_id}/callback`.replace(`{${'team_id'}}`, encodeURIComponent(String(requestParameters.teamId))),
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.addTeamCallback,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Add a success/failure callback to a team  Use this if if you want different teams to have different success/failure callbacks  Parameters: - callback_name (Literal[\"langfuse\", \"langsmith\", \"gcs\"], required): The name of the callback to add - callback_type (Literal[\"success\", \"failure\", \"success_and_failure\"], required): The type of callback to add. One of:     - \"success\": Callback for successful LLM calls     - \"failure\": Callback for failed LLM calls     - \"success_and_failure\": Callback for both successful and failed LLM calls - callback_vars (StandardCallbackDynamicParams, required): A dictionary of variables to pass to the callback     - langfuse_public_key: The public key for the Langfuse callback     - langfuse_secret_key: The secret key for the Langfuse callback     - langfuse_secret: The secret for the Langfuse callback     - langfuse_host: The host for the Langfuse callback     - gcs_bucket_name: The name of the GCS bucket     - gcs_path_service_account: The path to the GCS service account     - langsmith_api_key: The API key for the Langsmith callback     - langsmith_project: The project for the Langsmith callback     - langsmith_base_url: The base URL for the Langsmith callback  Example curl: ``` curl -X POST \'http:/localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback\'         -H \'Content-Type: application/json\'         -H \'Authorization: Bearer sk-1234\'         -d \'{     \"callback_name\": \"langfuse\",     \"callback_type\": \"success\",     \"callback_vars\": {\"langfuse_public_key\": \"pk-lf-xxxx1\", \"langfuse_secret_key\": \"sk-xxxxx\"}      }\' ```  This means for the team where team_id = dbe2f686-a686-4896-864a-4c3924458709, all LLM calls will be logged to langfuse using the public key pk-lf-xxxx1 and the secret key sk-xxxxx
     * Add Team Callbacks
     */
    addTeamCallbacksTeamTeamIdCallbackPost(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const response = yield this.addTeamCallbacksTeamTeamIdCallbackPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Blocks all calls from keys with this team id.  Parameters: - team_id: str - Required. The unique identifier of the team to block.  Example: ``` curl --location \'http://0.0.0.0:4000/team/block\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\" }\' ```  Returns: - The updated team record with blocked=True
     * Block Team
     */
    blockTeamTeamBlockPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/block`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.blockTeamRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Blocks all calls from keys with this team id.  Parameters: - team_id: str - Required. The unique identifier of the team to block.  Example: ``` curl --location \'http://0.0.0.0:4000/team/block\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\" }\' ```  Returns: - The updated team record with blocked=True
     * Block Team
     */
    blockTeamTeamBlockPost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.blockTeamTeamBlockPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * delete team and associated team keys  Parameters: - team_ids: List[str] - Required. List of team IDs to delete. Example: [\"team-1234\", \"team-5678\"]  ``` curl --location \'http://0.0.0.0:4000/team/delete\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data-raw \'{     \"team_ids\": [\"8d916b1c-510d-4894-a334-1c16a93344f5\"] }\' ```
     * Delete Team
     */
    deleteTeamTeamDeletePostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (requestParameters.litellmChangedBy != null) {
                headerParameters['litellm-changed-by'] = String(requestParameters.litellmChangedBy);
            }
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/delete`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.deleteTeamRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * delete team and associated team keys  Parameters: - team_ids: List[str] - Required. List of team IDs to delete. Example: [\"team-1234\", \"team-5678\"]  ``` curl --location \'http://0.0.0.0:4000/team/delete\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data-raw \'{     \"team_ids\": [\"8d916b1c-510d-4894-a334-1c16a93344f5\"] }\' ```
     * Delete Team
     */
    deleteTeamTeamDeletePost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.deleteTeamTeamDeletePostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Disable all logging callbacks for a team  Parameters: - team_id (str, required): The unique identifier for the team  Example curl: ``` curl -X POST \'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/disable_logging\'         -H \'Authorization: Bearer sk-1234\' ```
     * Disable Team Logging
     */
    disableTeamLoggingTeamTeamIdDisableLoggingPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            if (requestParameters.teamId == null) {
                throw new runtime.RequiredError('teamId', 'Required parameter "teamId" was null or undefined when calling disableTeamLoggingTeamTeamIdDisableLoggingPost().');
            }
            const queryParameters = {};
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/{team_id}/disable_logging`.replace(`{${'team_id'}}`, encodeURIComponent(String(requestParameters.teamId))),
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Disable all logging callbacks for a team  Parameters: - team_id (str, required): The unique identifier for the team  Example curl: ``` curl -X POST \'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/disable_logging\'         -H \'Authorization: Bearer sk-1234\' ```
     * Disable Team Logging
     */
    disableTeamLoggingTeamTeamIdDisableLoggingPost(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const response = yield this.disableTeamLoggingTeamTeamIdDisableLoggingPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Get the success/failure callbacks and variables for a team  Parameters: - team_id (str, required): The unique identifier for the team  Example curl: ``` curl -X GET \'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback\'         -H \'Authorization: Bearer sk-1234\' ```  This will return the callback settings for the team with id dbe2f686-a686-4896-864a-4c3924458709  Returns {         \"status\": \"success\",         \"data\": {             \"team_id\": team_id,             \"success_callbacks\": team_callback_settings_obj.success_callback,             \"failure_callbacks\": team_callback_settings_obj.failure_callback,             \"callback_vars\": team_callback_settings_obj.callback_vars,         },     }
     * Get Team Callbacks
     */
    getTeamCallbacksTeamTeamIdCallbackGetRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            if (requestParameters.teamId == null) {
                throw new runtime.RequiredError('teamId', 'Required parameter "teamId" was null or undefined when calling getTeamCallbacksTeamTeamIdCallbackGet().');
            }
            const queryParameters = {};
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/{team_id}/callback`.replace(`{${'team_id'}}`, encodeURIComponent(String(requestParameters.teamId))),
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Get the success/failure callbacks and variables for a team  Parameters: - team_id (str, required): The unique identifier for the team  Example curl: ``` curl -X GET \'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback\'         -H \'Authorization: Bearer sk-1234\' ```  This will return the callback settings for the team with id dbe2f686-a686-4896-864a-4c3924458709  Returns {         \"status\": \"success\",         \"data\": {             \"team_id\": team_id,             \"success_callbacks\": team_callback_settings_obj.success_callback,             \"failure_callbacks\": team_callback_settings_obj.failure_callback,             \"callback_vars\": team_callback_settings_obj.callback_vars,         },     }
     * Get Team Callbacks
     */
    getTeamCallbacksTeamTeamIdCallbackGet(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const response = yield this.getTeamCallbacksTeamTeamIdCallbackGetRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * ``` curl --location --request GET \'http://0.0.0.0:4000/team/list\'         --header \'Authorization: Bearer sk-1234\' ```  Parameters: - user_id: str - Optional. If passed will only return teams that the user_id is a member of. - organization_id: str - Optional. If passed will only return teams that belong to the organization_id. Pass \'default_organization\' to get all teams without organization_id.
     * List Team
     */
    listTeamTeamListGetRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            if (requestParameters.userId != null) {
                queryParameters.user_id = requestParameters.userId;
            }
            if (requestParameters.organizationId != null) {
                queryParameters.organization_id = requestParameters.organizationId;
            }
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/list`,
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * ``` curl --location --request GET \'http://0.0.0.0:4000/team/list\'         --header \'Authorization: Bearer sk-1234\' ```  Parameters: - user_id: str - Optional. If passed will only return teams that the user_id is a member of. - organization_id: str - Optional. If passed will only return teams that belong to the organization_id. Pass \'default_organization\' to get all teams without organization_id.
     * List Team
     */
    listTeamTeamListGet() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.listTeamTeamListGetRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Allow users to create a new team. Apply user permissions to their team.  👉 [Detailed Doc on setting team budgets](https://docs.litellm.ai/docs/proxy/team_budgets)   Parameters: - team_alias: Optional[str] - User defined team alias - team_id: Optional[str] - The team id of the user. If none passed, we\'ll generate it. - members_with_roles: List[{\"role\": \"admin\" or \"user\", \"user_id\": \"<user-id>\"}] - A list of users and their roles in the team. Get user_id when making a new user via `/user/new`. - metadata: Optional[dict] - Metadata for team, store information for team. Example metadata = {\"extra_info\": \"some info\"} - tpm_limit: Optional[int] - The TPM (Tokens Per Minute) limit for this team - all keys with this team_id will have at max this TPM limit - rpm_limit: Optional[int] - The RPM (Requests Per Minute) limit for this team - all keys associated with this team_id will have at max this RPM limit - max_budget: Optional[float] - The maximum budget allocated to the team - all keys for this team_id will have at max this max_budget - budget_duration: Optional[str] - The duration of the budget for the team. Doc [here](https://docs.litellm.ai/docs/proxy/team_budgets) - models: Optional[list] - A list of models associated with the team - all keys for this team_id will have at most, these models. If empty, assumes all models are allowed. - blocked: bool - Flag indicating if the team is blocked or not - will stop all calls from keys with this team_id. - members: Optional[List] - Control team members via `/team/member/add` and `/team/member/delete`.  - tags: Optional[List[str]] - Tags for [tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags) and/or doing [tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing). - organization_id: Optional[str] - The organization id of the team. Default is None. Create via `/organization/new`. - model_aliases: Optional[dict] - Model aliases for the team. [Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias) - guardrails: Optional[List[str]] - Guardrails for the team. [Docs](https://docs.litellm.ai/docs/proxy/guardrails) Returns: - team_id: (str) Unique team id - used for tracking spend across multiple keys for same team id.  _deprecated_params: - admins: list - A list of user_id\'s for the admin role - users: list - A list of user_id\'s for the user role  Example Request: ``` curl --location \'http://0.0.0.0:4000/team/new\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{   \"team_alias\": \"my-new-team_2\",   \"members_with_roles\": [{\"role\": \"admin\", \"user_id\": \"user-1234\"},     {\"role\": \"user\", \"user_id\": \"user-2434\"}] }\'  ```   ``` curl --location \'http://0.0.0.0:4000/team/new\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{             \"team_alias\": \"QA Prod Bot\",              \"max_budget\": 0.000000001,              \"budget_duration\": \"1d\"         }\' ```
     * New Team
     */
    newTeamTeamNewPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (requestParameters.litellmChangedBy != null) {
                headerParameters['litellm-changed-by'] = String(requestParameters.litellmChangedBy);
            }
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/new`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.newTeamRequest,
            }, initOverrides);
            return new runtime.JSONApiResponse(response);
        });
    }
    /**
     * Allow users to create a new team. Apply user permissions to their team.  👉 [Detailed Doc on setting team budgets](https://docs.litellm.ai/docs/proxy/team_budgets)   Parameters: - team_alias: Optional[str] - User defined team alias - team_id: Optional[str] - The team id of the user. If none passed, we\'ll generate it. - members_with_roles: List[{\"role\": \"admin\" or \"user\", \"user_id\": \"<user-id>\"}] - A list of users and their roles in the team. Get user_id when making a new user via `/user/new`. - metadata: Optional[dict] - Metadata for team, store information for team. Example metadata = {\"extra_info\": \"some info\"} - tpm_limit: Optional[int] - The TPM (Tokens Per Minute) limit for this team - all keys with this team_id will have at max this TPM limit - rpm_limit: Optional[int] - The RPM (Requests Per Minute) limit for this team - all keys associated with this team_id will have at max this RPM limit - max_budget: Optional[float] - The maximum budget allocated to the team - all keys for this team_id will have at max this max_budget - budget_duration: Optional[str] - The duration of the budget for the team. Doc [here](https://docs.litellm.ai/docs/proxy/team_budgets) - models: Optional[list] - A list of models associated with the team - all keys for this team_id will have at most, these models. If empty, assumes all models are allowed. - blocked: bool - Flag indicating if the team is blocked or not - will stop all calls from keys with this team_id. - members: Optional[List] - Control team members via `/team/member/add` and `/team/member/delete`.  - tags: Optional[List[str]] - Tags for [tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags) and/or doing [tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing). - organization_id: Optional[str] - The organization id of the team. Default is None. Create via `/organization/new`. - model_aliases: Optional[dict] - Model aliases for the team. [Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias) - guardrails: Optional[List[str]] - Guardrails for the team. [Docs](https://docs.litellm.ai/docs/proxy/guardrails) Returns: - team_id: (str) Unique team id - used for tracking spend across multiple keys for same team id.  _deprecated_params: - admins: list - A list of user_id\'s for the admin role - users: list - A list of user_id\'s for the user role  Example Request: ``` curl --location \'http://0.0.0.0:4000/team/new\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{   \"team_alias\": \"my-new-team_2\",   \"members_with_roles\": [{\"role\": \"admin\", \"user_id\": \"user-1234\"},     {\"role\": \"user\", \"user_id\": \"user-2434\"}] }\'  ```   ``` curl --location \'http://0.0.0.0:4000/team/new\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{             \"team_alias\": \"QA Prod Bot\",              \"max_budget\": 0.000000001,              \"budget_duration\": \"1d\"         }\' ```
     * New Team
     */
    newTeamTeamNewPost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.newTeamTeamNewPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * get info on team + related keys  Parameters: - team_id: str - Required. The unique identifier of the team to get info on.  ``` curl --location \'http://localhost:4000/team/info?team_id=your_team_id_here\'     --header \'Authorization: Bearer your_api_key_here\' ```
     * Team Info
     */
    teamInfoTeamInfoGetRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            if (requestParameters.teamId != null) {
                queryParameters.team_id = requestParameters.teamId;
            }
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/info`,
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * get info on team + related keys  Parameters: - team_id: str - Required. The unique identifier of the team to get info on.  ``` curl --location \'http://localhost:4000/team/info?team_id=your_team_id_here\'     --header \'Authorization: Bearer your_api_key_here\' ```
     * Team Info
     */
    teamInfoTeamInfoGet() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.teamInfoTeamInfoGetRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * [BETA]  Add new members (either via user_email or user_id) to a team  If user doesn\'t exist, new user row will also be added to User Table  Only proxy_admin or admin of team, allowed to access this endpoint. ```  curl -X POST \'http://0.0.0.0:4000/team/member_add\'     -H \'Authorization: Bearer sk-1234\'     -H \'Content-Type: application/json\'     -d \'{\"team_id\": \"45e3e396-ee08-4a61-a88e-16b3ce7e0849\", \"member\": {\"role\": \"user\", \"user_id\": \"krrish247652@berri.ai\"}}\'  ```
     * Team Member Add
     */
    teamMemberAddTeamMemberAddPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/member_add`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.teamMemberAddRequest,
            }, initOverrides);
            return new runtime.JSONApiResponse(response);
        });
    }
    /**
     * [BETA]  Add new members (either via user_email or user_id) to a team  If user doesn\'t exist, new user row will also be added to User Table  Only proxy_admin or admin of team, allowed to access this endpoint. ```  curl -X POST \'http://0.0.0.0:4000/team/member_add\'     -H \'Authorization: Bearer sk-1234\'     -H \'Content-Type: application/json\'     -d \'{\"team_id\": \"45e3e396-ee08-4a61-a88e-16b3ce7e0849\", \"member\": {\"role\": \"user\", \"user_id\": \"krrish247652@berri.ai\"}}\'  ```
     * Team Member Add
     */
    teamMemberAddTeamMemberAddPost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.teamMemberAddTeamMemberAddPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * [BETA]  delete members (either via user_email or user_id) from a team  If user doesn\'t exist, an exception will be raised ``` curl -X POST \'http://0.0.0.0:8000/team/member_delete\'  -H \'Authorization: Bearer sk-1234\'  -H \'Content-Type: application/json\'  -d \'{     \"team_id\": \"45e3e396-ee08-4a61-a88e-16b3ce7e0849\",     \"user_id\": \"krrish247652@berri.ai\" }\' ```
     * Team Member Delete
     */
    teamMemberDeleteTeamMemberDeletePostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/member_delete`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.teamMemberDeleteRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * [BETA]  delete members (either via user_email or user_id) from a team  If user doesn\'t exist, an exception will be raised ``` curl -X POST \'http://0.0.0.0:8000/team/member_delete\'  -H \'Authorization: Bearer sk-1234\'  -H \'Content-Type: application/json\'  -d \'{     \"team_id\": \"45e3e396-ee08-4a61-a88e-16b3ce7e0849\",     \"user_id\": \"krrish247652@berri.ai\" }\' ```
     * Team Member Delete
     */
    teamMemberDeleteTeamMemberDeletePost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.teamMemberDeleteTeamMemberDeletePostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * [BETA]  Update team member budgets and team member role
     * Team Member Update
     */
    teamMemberUpdateTeamMemberUpdatePostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/member_update`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.teamMemberUpdateRequest,
            }, initOverrides);
            return new runtime.JSONApiResponse(response);
        });
    }
    /**
     * [BETA]  Update team member budgets and team member role
     * Team Member Update
     */
    teamMemberUpdateTeamMemberUpdatePost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.teamMemberUpdateTeamMemberUpdatePostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Add models to a team\'s allowed model list. Only proxy admin or team admin can add models.  Parameters: - team_id: str - Required. The team to add models to - models: List[str] - Required. List of models to add to the team  Example Request: ``` curl --location \'http://0.0.0.0:4000/team/model/add\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\",     \"models\": [\"gpt-4\", \"claude-2\"] }\' ```
     * Team Model Add
     */
    teamModelAddTeamModelAddPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/model/add`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.teamModelAddRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Add models to a team\'s allowed model list. Only proxy admin or team admin can add models.  Parameters: - team_id: str - Required. The team to add models to - models: List[str] - Required. List of models to add to the team  Example Request: ``` curl --location \'http://0.0.0.0:4000/team/model/add\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\",     \"models\": [\"gpt-4\", \"claude-2\"] }\' ```
     * Team Model Add
     */
    teamModelAddTeamModelAddPost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.teamModelAddTeamModelAddPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Remove models from a team\'s allowed model list. Only proxy admin or team admin can remove models.  Parameters: - team_id: str - Required. The team to remove models from - models: List[str] - Required. List of models to remove from the team  Example Request: ``` curl --location \'http://0.0.0.0:4000/team/model/delete\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\",     \"models\": [\"gpt-4\"] }\' ```
     * Team Model Delete
     */
    teamModelDeleteTeamModelDeletePostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/model/delete`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.teamModelDeleteRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Remove models from a team\'s allowed model list. Only proxy admin or team admin can remove models.  Parameters: - team_id: str - Required. The team to remove models from - models: List[str] - Required. List of models to remove from the team  Example Request: ``` curl --location \'http://0.0.0.0:4000/team/model/delete\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\",     \"models\": [\"gpt-4\"] }\' ```
     * Team Model Delete
     */
    teamModelDeleteTeamModelDeletePost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.teamModelDeleteTeamModelDeletePostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Blocks all calls from keys with this team id.  Parameters: - team_id: str - Required. The unique identifier of the team to unblock.  Example: ``` curl --location \'http://0.0.0.0:4000/team/unblock\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\" }\' ```
     * Unblock Team
     */
    unblockTeamTeamUnblockPostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/unblock`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.blockTeamRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Blocks all calls from keys with this team id.  Parameters: - team_id: str - Required. The unique identifier of the team to unblock.  Example: ``` curl --location \'http://0.0.0.0:4000/team/unblock\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data \'{     \"team_id\": \"team-1234\" }\' ```
     * Unblock Team
     */
    unblockTeamTeamUnblockPost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.unblockTeamTeamUnblockPostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Use `/team/member_add` AND `/team/member/delete` to add/remove new team members    You can now update team budget / rate limits via /team/update  Parameters: - team_id: str - The team id of the user. Required param. - team_alias: Optional[str] - User defined team alias - metadata: Optional[dict] - Metadata for team, store information for team. Example metadata = {\"team\": \"core-infra\", \"app\": \"app2\", \"email\": \"ishaan@berri.ai\" } - tpm_limit: Optional[int] - The TPM (Tokens Per Minute) limit for this team - all keys with this team_id will have at max this TPM limit - rpm_limit: Optional[int] - The RPM (Requests Per Minute) limit for this team - all keys associated with this team_id will have at max this RPM limit - max_budget: Optional[float] - The maximum budget allocated to the team - all keys for this team_id will have at max this max_budget - budget_duration: Optional[str] - The duration of the budget for the team. Doc [here](https://docs.litellm.ai/docs/proxy/team_budgets) - models: Optional[list] - A list of models associated with the team - all keys for this team_id will have at most, these models. If empty, assumes all models are allowed. - blocked: bool - Flag indicating if the team is blocked or not - will stop all calls from keys with this team_id. - tags: Optional[List[str]] - Tags for [tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags) and/or doing [tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing). - organization_id: Optional[str] - The organization id of the team. Default is None. Create via `/organization/new`. - model_aliases: Optional[dict] - Model aliases for the team. [Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias) - guardrails: Optional[List[str]] - Guardrails for the team. [Docs](https://docs.litellm.ai/docs/proxy/guardrails) Example - update team TPM Limit  ``` curl --location \'http://0.0.0.0:4000/team/update\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data-raw \'{     \"team_id\": \"8d916b1c-510d-4894-a334-1c16a93344f5\",     \"tpm_limit\": 100 }\' ```  Example - Update Team `max_budget` budget ``` curl --location \'http://0.0.0.0:4000/team/update\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data-raw \'{     \"team_id\": \"8d916b1c-510d-4894-a334-1c16a93344f5\",     \"max_budget\": 10 }\' ```
     * Update Team
     */
    updateTeamTeamUpdatePostRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            headerParameters['Content-Type'] = 'application/json';
            if (requestParameters.litellmChangedBy != null) {
                headerParameters['litellm-changed-by'] = String(requestParameters.litellmChangedBy);
            }
            if (this.configuration && this.configuration.accessToken) {
                const token = this.configuration.accessToken;
                const tokenString = yield token('bearer', []);
                if (tokenString) {
                    headerParameters.Authorization = `Bearer ${tokenString}`;
                }
            }
            const response = yield this.request({
                path: `/team/update`,
                method: 'POST',
                headers: headerParameters,
                query: queryParameters,
                body: requestParameters.updateTeamRequest,
            }, initOverrides);
            if (this.isJsonMime(response.headers.get('content-type'))) {
                return new runtime.JSONApiResponse(response);
            }
            else {
                return new runtime.TextApiResponse(response);
            }
        });
    }
    /**
     * Use `/team/member_add` AND `/team/member/delete` to add/remove new team members    You can now update team budget / rate limits via /team/update  Parameters: - team_id: str - The team id of the user. Required param. - team_alias: Optional[str] - User defined team alias - metadata: Optional[dict] - Metadata for team, store information for team. Example metadata = {\"team\": \"core-infra\", \"app\": \"app2\", \"email\": \"ishaan@berri.ai\" } - tpm_limit: Optional[int] - The TPM (Tokens Per Minute) limit for this team - all keys with this team_id will have at max this TPM limit - rpm_limit: Optional[int] - The RPM (Requests Per Minute) limit for this team - all keys associated with this team_id will have at max this RPM limit - max_budget: Optional[float] - The maximum budget allocated to the team - all keys for this team_id will have at max this max_budget - budget_duration: Optional[str] - The duration of the budget for the team. Doc [here](https://docs.litellm.ai/docs/proxy/team_budgets) - models: Optional[list] - A list of models associated with the team - all keys for this team_id will have at most, these models. If empty, assumes all models are allowed. - blocked: bool - Flag indicating if the team is blocked or not - will stop all calls from keys with this team_id. - tags: Optional[List[str]] - Tags for [tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags) and/or doing [tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing). - organization_id: Optional[str] - The organization id of the team. Default is None. Create via `/organization/new`. - model_aliases: Optional[dict] - Model aliases for the team. [Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias) - guardrails: Optional[List[str]] - Guardrails for the team. [Docs](https://docs.litellm.ai/docs/proxy/guardrails) Example - update team TPM Limit  ``` curl --location \'http://0.0.0.0:4000/team/update\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data-raw \'{     \"team_id\": \"8d916b1c-510d-4894-a334-1c16a93344f5\",     \"tpm_limit\": 100 }\' ```  Example - Update Team `max_budget` budget ``` curl --location \'http://0.0.0.0:4000/team/update\'     --header \'Authorization: Bearer sk-1234\'     --header \'Content-Type: application/json\'     --data-raw \'{     \"team_id\": \"8d916b1c-510d-4894-a334-1c16a93344f5\",     \"max_budget\": 10 }\' ```
     * Update Team
     */
    updateTeamTeamUpdatePost() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.updateTeamTeamUpdatePostRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
}
exports.TeamManagementApi = TeamManagementApi;