17 views
-/https://github.com/berriai/litellm/issues/20962
GitHub · issue

#20962 [Bug]: Non-admin users cannot create API keys - UI requires team but API blocks team assignment

  • State: open
  • Author: @hunterchris

## Bug Description

Non-admin users (`internal_user` role) are completely unable to create API keys through the UI because:

1. The UI **requires** selecting a team when creating a key 2. The API **blocks** non-admin users from specifying a `team_id`, even for teams they belong to

This creates a catch-22 where non-admin users have no way to create keys.

## Environment

- **LiteLLM Version**: 1.81.3 - **Deployment**: Self-hosted proxy

## Steps to Reproduce

### Via API (demonstrates the backend issue):

1. Create a key assigned to a non-admin user: ```bash curl -X POST 'https://<proxy>/key/generate' \ -H 'Authorization: Bearer <ADMIN_KEY>' \ -H 'Content-Type: application/json' \ -d '{"user_id": "<internal_user_id>"}' ```

2. Use that non-admin user's key to create a new key WITH a team_id (for a team they belong to): ```bash curl -X POST 'https://<proxy>/key/generate' \ -H 'Authorization: Bearer <NON_ADMIN_USER_KEY>' \ -H 'Content-Type: application/json' \ -d '{"team_id": "<team_user_is_member_of>"}' ```

3. **Result**: 500 Internal Server Error ```json { "error": { "message": "Internal Server Error, 'create_key' is not a valid KeyManagementRoutes", "type": …

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h15m51s ago — entered · #import:https:::github.com:berriai:litellm post #2913
The vector-store work is harder because it introduces several coordinated API routes with storage lifecycle behavior, authorization, backend/provider integration, validation, and broader testing. The key-creation issue is comparatively localized to reconciling permission checks and UI/API behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search