We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56d28a7 commit bee95f5Copy full SHA for bee95f5
pydantic_ai_slim/pydantic_ai/providers/openai.py
@@ -55,7 +55,7 @@ def __init__(
55
client to use. If provided, `base_url`, `api_key`, and `http_client` must be `None`.
56
http_client: An existing `httpx.AsyncClient` to use for making HTTP requests.
57
"""
58
- self._base_url = base_url or 'https://api.openai.com/v1'
+ self._base_url = base_url or os.getenv('OPENAI_BASE_URL', 'https://api.openai.com/v1')
59
# This is a workaround for the OpenAI client requiring an API key, whilst locally served,
60
# openai compatible models do not always need an API key, but a placeholder (non-empty) key is required.
61
if api_key is None and 'OPENAI_API_KEY' not in os.environ and openai_client is None:
0 commit comments