[GH-ISSUE #12086] feat: Add get user api key endpoint for admins #31995

Closed
opened 2026-04-25 05:52:48 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @shohamyamin on GitHub (Mar 26, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12086

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

In scenarios where an application uses Open WebUI as a gateway to manage user access, there is a need for the application to access Open WebUI on behalf of specific users. Currently, there may be a gap in functionality, as there is no apparent method for an admin user to retrieve a user's API key via the Open WebUI API. This limitation can hinder seamless application integration and prevent smooth delegation of access on behalf of users.

Desired Solution you'd like

Introduce a feature in the Open WebUI API that allows an admin user to retrieve a specific user's API key. This functionality would enable the application to act on behalf of the user by using their API key to access Open WebUI. The solution should include appropriate security measures, such as:

  • Strict role-based access control (RBAC) to ensure that only authorized admin users can access user API keys.
    
  • Audit logging to track when and by whom API keys are accessed for transparency and compliance.
    

This enhancement would streamline integrations and improve the flexibility of applications interacting with Open WebUI on behalf of users.

Alternatives Considered

No response

Additional Context

No response

Originally created by @shohamyamin on GitHub (Mar 26, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12086 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description In scenarios where an application uses Open WebUI as a gateway to manage user access, there is a need for the application to access Open WebUI on behalf of specific users. Currently, there may be a gap in functionality, as there is no apparent method for an admin user to retrieve a user's API key via the Open WebUI API. This limitation can hinder seamless application integration and prevent smooth delegation of access on behalf of users. ### Desired Solution you'd like Introduce a feature in the Open WebUI API that allows an admin user to retrieve a specific user's API key. This functionality would enable the application to act on behalf of the user by using their API key to access Open WebUI. The solution should include appropriate security measures, such as: - Strict role-based access control (RBAC) to ensure that only authorized admin users can access user API keys. - Audit logging to track when and by whom API keys are accessed for transparency and compliance. This enhancement would streamline integrations and improve the flexibility of applications interacting with Open WebUI on behalf of users. ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Mar 27, 2025):

You can do this via python scripts.

<!-- gh-comment-id:2756506339 --> @tjbck commented on GitHub (Mar 27, 2025): You can do this via python scripts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#31995