Users¶
Users represent individual accounts in your LiteLLM system. They provide the foundation for authentication, authorization, and budget management.
Overview¶
User resources in the LiteLLM Operator provide:
- Identity Management - Define user accounts and roles
- Budget Control - Set spending limits per user
- Role-Based Access - Assign different permission levels
- Usage Tracking - Monitor individual user consumption
- Automatic Key Creation - Generate virtual keys automatically
Creating Users¶
Basic User¶
apiVersion: auth.litellm.ai/v1alpha1
kind: User
metadata:
name: alice
spec:
userEmail: "alice@example.com"
userAlias: "alice"
userRole: "internal_user_viewer"
keyAlias: "alice-key"
autoCreateKey: true
models:
- "gpt-4o"
maxBudget: "10"
budgetDuration: 1h
connectionRef:
instanceRef:
name: litellm-example
namespace: litellm
Admin User¶
apiVersion: auth.litellm.ai/v1alpha1
kind: User
metadata:
name: admin-user
spec:
userEmail: "admin@example.com"
userAlias: "admin"
userRole: "admin"
keyAlias: "admin-key"
autoCreateKey: true
models:
- "gpt-4o"
- "claude-3-sonnet"
maxBudget: "1000"
budgetDuration: 30d
connectionRef:
instanceRef:
name: litellm-example
namespace: litellm
Specification Reference¶
| Field | Type | Description | Required |
|---|---|---|---|
userEmail |
string | User's email address | Yes |
userAlias |
string | User alias/username | Yes |
userRole |
string | User role (one of "proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer") | Yes |
keyAlias |
string | Alias for the virtual key | No |
autoCreateKey |
boolean | Automatically create virtual key | Yes |
models |
[]string | Allowed models for this user | No |
maxBudget |
string | Maximum spend limit in dollars | Yes |
budgetDuration |
string | Budget duration (e.g., "1h", "30d") | Yes |
connectionRef |
object | Reference to LiteLLM instance | Yes |
Managing Users¶
List Users¶
Get User Details¶
Update User Budget¶
Delete a User¶
Best Practices¶
- Set appropriate budget limits based on usage patterns
- Use meaningful key aliases for easy identification
- Enable autoCreateKey for seamless user onboarding
- Set reasonable budget durations to prevent overspending
- Regularly review and update user permissions
Next Steps¶
- Learn about Teams and Team Member Associations
- Create Virtual Keys for users
- Set up user monitoring and alerts