Environment Variables
LLM & Provider
| Variable | Description |
|---|---|
AGENTIX_PROVIDER | Override default provider (anthropic, openai, gemini, deepseek, openai_compatible) |
AGENTIX_MODEL | Override default model |
AGENTIX_API_KEY | API key for the LLM provider (the only supported way to pass an API key via environment) |
AGENTIX_BASE_URL | Override API base URL (openai_compatible and deepseek only; native providers ignore this) |
Workspace
| Variable | Description |
|---|---|
AGENTIX_CWD | Override working directory |
Timeouts
| Variable | Default | Description |
|---|---|---|
AGENTIX_TOOL_TIMEOUT | 120 | Seconds before a tool call is killed |
AGENTIX_SCRIPT_TIMEOUT | 30 | Subprocess timeout for scripts |
AGENTIX_MCP_CONNECT_TIMEOUT | 60 | MCP server handshake timeout |
AGENTIX_WEB_FETCH_TIMEOUT | 15 | HTTP timeout for WebFetch |
Web Search
| Variable | Description |
|---|---|
TAVILY_API_KEY | Tavily web search API key (recommended) |
BRAVE_API_KEY | Brave Search API key |
SERPAPI_API_KEY | SerpAPI key |
When none of these are set, WebSearch falls back to DuckDuckGo.
Gateway
| Variable | Description |
|---|---|
AGENTIX_GATEWAY_PROJECT_CWD | Project 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")