diff --git a/docs/my-website/docs/proxy/self_serve.md b/docs/my-website/docs/proxy/self_serve.md new file mode 100644 index 00000000000..568e6541a62 --- /dev/null +++ b/docs/my-website/docs/proxy/self_serve.md @@ -0,0 +1,126 @@ +import Image from '@theme/IdealImage'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# 🤗 UI - Self-Serve + +Allow users to creat their own keys on [Proxy UI](./ui.md). + +1. Add user with permissions to a team on proxy + + + + +Go to `Internal Users` -> `+New User` + + + + + + +Create a new Internal User on LiteLLM and assign them the role `internal_user`. + +```bash +curl -X POST '/user/new' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +-D '{ + "user_email": "krrishdholakia@gmail.com", + "user_role": "internal_user" # 👈 THIS ALLOWS USER TO CREATE/VIEW/DELETE THEIR OWN KEYS + SEE THEIR SPEND +}' +``` + +Expected Response + +```bash +{ + "user_id": "e9d45c7c-b20b-4ff8-ae76-3f479a7b1d7d", 👈 USE IN STEP 2 + "user_email": "", + "user_role": "internal_user", + ... +} +``` + +Here's the available UI roles for a LiteLLM Internal User: + +Admin Roles: + - `proxy_admin`: admin over the platform + - `proxy_admin_viewer`: can login, view all keys, view all spend. **Cannot** create/delete keys, add new users. + +Internal User Roles: + - `internal_user`: can login, view/create/delete their own keys, view their spend. **Cannot** add new users. + - `internal_user_viewer`: can login, view their own keys, view their own spend. **Cannot** create/delete keys, add new users. + + + + +2. Share invitation link with user + + + + +Copy the invitation link with the user + + + + + + +```bash +curl -X POST '/invitation/new' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +-D '{ + "user_id": "e9d45c7c-b20b..." # 👈 USER ID FROM STEP 1 +}' +``` + +Expected Response + +```bash +{ + "id": "a2f0918f-43b0-4770-a664-96ddd192966e", + "user_id": "e9d45c7c-b20b..", + "is_accepted": false, + "accepted_at": null, + "expires_at": "2024-06-13T00:02:16.454000Z", # 👈 VALID FOR 7d + "created_at": "2024-06-06T00:02:16.454000Z", + "created_by": "116544810872468347480", + "updated_at": "2024-06-06T00:02:16.454000Z", + "updated_by": "116544810872468347480" +} +``` + +Invitation Link: + +```bash +http://0.0.0.0:4000/ui/onboarding?id=a2f0918f-43b0-4770-a664-96ddd192966e + +# /ui/onboarding?id= +``` + + + + +:::info + +Use [Email Notifications](./email.md) to email users onboarding links + +::: + +3. User logs in via email + password auth + + + + + +:::info + +LiteLLM Enterprise: Enable [SSO login](./ui.md#setup-ssoauth-for-ui) + +::: + +4. User can now create their own keys + + + \ No newline at end of file diff --git a/docs/my-website/docs/proxy/ui.md b/docs/my-website/docs/proxy/ui.md index 19ffd4ca275..6a828075a7b 100644 --- a/docs/my-website/docs/proxy/ui.md +++ b/docs/my-website/docs/proxy/ui.md @@ -2,10 +2,9 @@ import Image from '@theme/IdealImage'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# [BETA] Proxy UI -### **Create + delete keys through a UI** +# [BETA] UI - Admin -[Let users create their own keys](#setup-ssoauth-for-ui) +Create keys, track spend, add models without worrying about the config / CRUD endpoints. :::info diff --git a/docs/my-website/img/add_internal_user.png b/docs/my-website/img/add_internal_user.png new file mode 100644 index 00000000000..7a2df91a48c Binary files /dev/null and b/docs/my-website/img/add_internal_user.png differ diff --git a/docs/my-website/img/invitation_link.png b/docs/my-website/img/invitation_link.png new file mode 100644 index 00000000000..42e2f970350 Binary files /dev/null and b/docs/my-website/img/invitation_link.png differ diff --git a/docs/my-website/img/ui_clean_login.png b/docs/my-website/img/ui_clean_login.png new file mode 100644 index 00000000000..6ee5c7ad2f8 Binary files /dev/null and b/docs/my-website/img/ui_clean_login.png differ diff --git a/docs/my-website/img/ui_self_serve_create_key.png b/docs/my-website/img/ui_self_serve_create_key.png new file mode 100644 index 00000000000..e93cefdd057 Binary files /dev/null and b/docs/my-website/img/ui_self_serve_create_key.png differ diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js index 651e34303d8..f5bdc945bad 100644 --- a/docs/my-website/sidebars.js +++ b/docs/my-website/sidebars.js @@ -40,6 +40,7 @@ const sidebars = { "proxy/configs", "proxy/reliability", "proxy/cost_tracking", + "proxy/self_serve", "proxy/users", "proxy/customers", "proxy/billing",