diff --git a/README.md b/README.md index 8291ea0..db508cd 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,7 @@ For example, add these lines to your `.bashrc`, `.zshrc`, or equivalent shell pr ```sh # For OpenAI export OPENAI_API_KEY="sk-..." +export OPENAI_API_BASE="https://provider.example.com/v1" # Optional: Use a custom OpenAI-compatible endpoint # For Anthropic export ANTHROPIC_API_KEY="..." diff --git a/src/voxd/core/aipp.py b/src/voxd/core/aipp.py index 6e206ca..0cb8512 100644 --- a/src/voxd/core/aipp.py +++ b/src/voxd/core/aipp.py @@ -62,7 +62,8 @@ def run_ollama_aipp(prompt: str, model: str = "llama3.2:latest") -> str: def run_openai_aipp(prompt: str, model: str = "gpt-3.5-turbo") -> str: - url = "https://api.openai.com/v1/chat/completions" + base_url = os.getenv("OPENAI_API_BASE", "https://api.openai.com/v1") + url = f"{base_url}/chat/completions" headers = { "Authorization": f"Bearer {os.getenv('OPENAI_API_KEY', '')}", "Content-Type": "application/json"