Originally created by @aryzle on GitHub (Feb 14, 2025).
Feature Request
Is your feature request related to a problem? Please describe.
When using Google Vertex AI, the API key expires every 1-12 hours (1 by default). Currently there's no way to automatically refresh the key, so it has to be done manually through the admin UI or via an API request to the /openai/config/update endpoint.
Describe alternatives you've considered
Currently you can either update the key manually in the ui or through the /openai/config/update endpoint. I've automated this by running a cron that updated the key every 55m.
Context
This would likely be helpful for other APIs as well, not just Vertex AI
Originally created by @aryzle on GitHub (Feb 14, 2025).
# Feature Request
**Is your feature request related to a problem? Please describe.**
When using Google Vertex AI, the API key expires every 1-12 hours (1 by default). Currently there's no way to automatically refresh the key, so it has to be done manually through the admin UI or via an API request to the `/openai/config/update` endpoint.
**Describe the solution you'd like**
https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library#refresh_your_credentials
There is an example here of refreshing creds automatically for google APIs. If there's a way to designate that we're using Vertex AI, then the app could refresh the token when it expires.
**Describe alternatives you've considered**
Currently you can either update the key manually in the ui or through the `/openai/config/update` endpoint. I've automated this by running a cron that updated the key every 55m.
```
TOKEN=$(gcloud auth application-default print-access-token)
curl -X POST "<openwebui-URL>/openai/config/update" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <openwebui API KEY>" \
-d "{
\"ENABLE_OPENAI_API\": true,
\"OPENAI_API_BASE_URLS\": [\"https://<REGION>-aiplatform.googleapis.com/v1beta1/projects/<PROJECTID>/locations/<REGION>/endpoints/openapi\"],
\"OPENAI_API_KEYS\": [\"$TOKEN\"],
\"OPENAI_API_CONFIGS\": {
\"0\": {
\"enable\": true,
\"model_ids\": [\"google/gemini-1.5-flash\", \"google/gemini-2.0-flash-exp\"]
}
}
}"
```
**Context**
This would likely be helpful for other APIs as well, not just Vertex AI
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @aryzle on GitHub (Feb 14, 2025).
Feature Request
Is your feature request related to a problem? Please describe.
When using Google Vertex AI, the API key expires every 1-12 hours (1 by default). Currently there's no way to automatically refresh the key, so it has to be done manually through the admin UI or via an API request to the
/openai/config/updateendpoint.Describe the solution you'd like
https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library#refresh_your_credentials
There is an example here of refreshing creds automatically for google APIs. If there's a way to designate that we're using Vertex AI, then the app could refresh the token when it expires.
Describe alternatives you've considered
Currently you can either update the key manually in the ui or through the
/openai/config/updateendpoint. I've automated this by running a cron that updated the key every 55m.Context
This would likely be helpful for other APIs as well, not just Vertex AI