From 3b19031342a0f967996b6a54c3c9a1ec25ece192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Campion?= Date: Fri, 2 Feb 2024 11:08:47 +0100 Subject: [PATCH] Allow to specify user email created via /user/new --- litellm/proxy/_types.py | 1 + litellm/proxy/proxy_server.py | 1 + 2 files changed, 2 insertions(+) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 42bffdcad0..eb70cc07ca 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -193,6 +193,7 @@ class DeleteKeyRequest(LiteLLMBase): class NewUserRequest(GenerateKeyRequest): max_budget: Optional[float] = None + user_email: Optional[str] = None class NewUserResponse(GenerateKeyResponse): diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index c97ebc2b09..6769c00cbc 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2935,6 +2935,7 @@ async def new_user(data: NewUserRequest): Parameters: - user_id: Optional[str] - Specify a user id. If not set, a unique id will be generated. + - user_email: Optional[str] - Specify a user email. - max_budget: Optional[float] - Specify max budget for a given user. - duration: Optional[str] - Specify the length of time the token is valid for. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d"). **(Default is set to 1 hour.)** - models: Optional[list] - Model_name's a user is allowed to call. (if empty, key is allowed to call all models)