Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

adding OPENAI_BASE_URL as fallback

João Moura7987bfee3928
diff --git a/src/crewai/agent.py b/src/crewai/agent.py
index a943c994d..b79d23a5f 100644
--- a/src/crewai/agent.py
+++ b/src/crewai/agent.py
@@ -132,7 +132,9 @@ class Agent(BaseAgent):
model_name = os.environ.get("OPENAI_MODEL_NAME", "gpt-4o-mini")
llm_params = {"model": model_name}
- api_base = os.environ.get("OPENAI_API_BASE")
+ api_base = os.environ.get("OPENAI_API_BASE") or os.environ.get(
+ "OPENAI_BASE_URL"
+ )
if api_base:
llm_params["base_url"] = api_base