add-user
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAdd User
添加用户
Create a new user on a live LiteLLM proxy.
在运行中的LiteLLM代理上创建新用户。
Setup
准备工作
Ask for these if not already known:
LITELLM_BASE_URL — e.g. https://my-proxy.example.com
LITELLM_API_KEY — proxy admin key如果尚未知晓以下信息,请询问用户:
LITELLM_BASE_URL — 示例:https://my-proxy.example.com
LITELLM_API_KEY — 代理管理员密钥Ask the user
询问用户信息
- Email (required)
- Role — one of: ,
proxy_admin,proxy_admin_viewer(default),internal_userinternal_user_viewer - Max budget (optional, e.g. )
10.00 - Allowed models (optional, e.g. )
gpt-4o, claude-3-5-sonnet
- 邮箱(必填)
- 角色 — 可选值:,
proxy_admin,proxy_admin_viewer(默认),internal_userinternal_user_viewer - 最高预算(可选,示例:)
10.00 - 允许使用的模型(可选,示例:)
gpt-4o, claude-3-5-sonnet
Run
执行
bash
curl -s -X POST "$BASE/user/new" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"user_email": "<email>",
"user_role": "<role>",
"max_budget": <budget_or_null>,
"models": [<models_or_empty>]
}'bash
curl -s -X POST "$BASE/user/new" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"user_email": "<email>",
"user_role": "<role>",
"max_budget": <budget_or_null>,
"models": [<models_or_empty>]
}'Output
输出内容
Show the user:
- — they'll need this for future updates
user_id - — the auto-generated API key for this user
key - ,
user_rolemax_budget
On error show and the likely fix.
detail向用户展示以下内容:
- — 用户后续更新会用到该ID
user_id - — 为该用户自动生成的API密钥
key - ,
user_rolemax_budget
若出现错误,展示字段信息及可能的修复方案。
detail