herin7 / herin7/gitforme

User-Provided Azure OpenAI API Credentials

Open
#14 4 comments 0 reactions 1 assignee View on GitHub

@FATEH02 is already working on this.

Since Aug 14, 2025.

enhancement
Dominant language
JavaScript
Stars
382
Forks
76
Avg merge
3m
Merged PRs (30d)
4

Description

Feature Request: User-Provided Azure OpenAI API Credentials

Overview

Currently, the application uses hardcoded Azure OpenAI credentials from environment variables. We want to implement a feature that allows users to provide their own Azure OpenAI API credentials through the frontend, which will be passed to the backend for LLM operations.

✨ Motivation

  • Users may want to use their own Azure OpenAI keys instead of relying on shared credentials.
  • This promotes transparency, flexibility, and improved access control.
  • However, users must feel confident that their credentials will not be leaked or misused.

🔐 Security & Trust Requirements

  • No logging or server-side storage of credentials.
  • Credentials must be used only for the current session/request and discarded immediately after use.
  • Frontend UI should clearly state that credentials are not stored or shared.
  • Inputs should be securely handled via HTTPS and never exposed in localStorage or sessionStorage.
  • Validate input formats and show helpful error messages if credentials are invalid.

Technical Requirements

Backend Changes
  1. Modify the /api/chat endpoint to accept Azure OpenAI credentials in the request payload
  2. Update the stream_llm_response function to use provided credentials instead of environment variables
  3. Add input validation for the API credentials
@app.route('/api/chat', methods=['POST'])
async def chat():
    data = request.get_json()
    
    # New credential fields
    azure_endpoint = data.get("azureEndpoint")
    api_key = data.get("apiKey")
    deployment = data.get("deployment")
    api_version = data.get("apiVersion", "2023-05-15")
    
    # Validate credentials
    if not all([azure_endpoint, api_key, deployment]):
        return jsonify({"error": "Missing required Azure OpenAI credentials"}), 400
        
    # Rest of the existing function...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.