Skip to main content

Environment Variables

LLM & Provider

VariableDescription
AGENTIX_PROVIDEROverride default provider (anthropic, openai, gemini, deepseek, openai_compatible)
AGENTIX_MODELOverride default model
AGENTIX_API_KEYAPI key for the LLM provider (the only supported way to pass an API key via environment)
AGENTIX_BASE_URLOverride API base URL (openai_compatible and deepseek only; native providers ignore this)

Workspace

VariableDescription
AGENTIX_CWDOverride working directory

Timeouts

VariableDefaultDescription
AGENTIX_TOOL_TIMEOUT120Seconds before a tool call is killed
AGENTIX_SCRIPT_TIMEOUT30Subprocess timeout for scripts
AGENTIX_MCP_CONNECT_TIMEOUT60MCP server handshake timeout
AGENTIX_WEB_FETCH_TIMEOUT15HTTP timeout for WebFetch
VariableDescription
TAVILY_API_KEYTavily web search API key (recommended)
BRAVE_API_KEYBrave Search API key
SERPAPI_API_KEYSerpAPI key

When none of these are set, WebSearch falls back to DuckDuckGo.

Gateway

VariableDescription
AGENTIX_GATEWAY_PROJECT_CWDProject root for gateway YAML resolution

Usage

Environment variables are read at construction time. Set them before creating AgentixAgentOptions:

import os
os.environ["AGENTIX_PROVIDER"] = "openai"
os.environ["AGENTIX_MODEL"] = "gpt-4o"

options = AgentixAgentOptions(name="my-agent")
# provider="openai", model="gpt-4o" from environment

Or use a .env file with python-dotenv:

pip install python-dotenv
from dotenv import load_dotenv
load_dotenv()

from agentix import AgentixAgentOptions
options = AgentixAgentOptions(name="my-agent")