diff --git a/docs/docs/configuration/genai.md b/docs/docs/configuration/genai.md index 68ea054d1..89405360d 100644 --- a/docs/docs/configuration/genai.md +++ b/docs/docs/configuration/genai.md @@ -112,9 +112,12 @@ genai: provider: openai api_key: "{FRIGATE_OPENAI_API_KEY}" model: gpt-4o - base_url: https://api.openai.com/v1 + base_url: http://example.endpoint/v1 # optional ``` +### Optional base_url Parameter +The base_url parameter is an optional configuration setting that allows you to specify a custom endpoint for the OpenAI API. By default, the OpenAI client uses the standard API endpoint provided by OpenAI. However, if you need to route your requests through a different server or use a proxy, you can set this parameter to the desired URL. + ## Azure OpenAI Microsoft offers several vision models through Azure OpenAI. A subscription is required. diff --git a/frigate/genai/openai.py b/frigate/genai/openai.py index 0d3ecaf65..ffc993d6c 100644 --- a/frigate/genai/openai.py +++ b/frigate/genai/openai.py @@ -22,8 +22,8 @@ class OpenAIClient(GenAIClient): def _init_provider(self): """Initialize the client.""" - if self.genai_config.base_url is None or self.genai_config.base_url == "": - self.genai_config.base_url = "https://api.openai.com/v1" + if self.genai_config.base_url == "": + self.genai_config.base_url = None return OpenAI( api_key=self.genai_config.api_key, base_url=self.genai_config.base_url