ChatAgents is configured entirely via environment variables. In local development these are loaded from aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EllisYuan/ChatAgents/llms.txt
Use this file to discover all available pages before exploring further.
.env file by python-dotenv; in Docker they are passed directly into each service container by docker-compose.yml. There are no hard-coded secrets in the codebase — every sensitive value lives in your .env file, making it safe to share code without exposing credentials.
Creating Your .env File
Start by copying the provided sample file:
.env and replace the placeholder values with your real API keys.
Variable Reference
Claude API key for Anthropic models. All Claude Haiku, Sonnet, and Opus model calls are authenticated with this key.Format:
Obtain: console.anthropic.com
sk-ant-api-...Obtain: console.anthropic.com
Tavily search API key, used by the
Obtain: tavily.com
TavilySearch, TavilyExtract, and TavilyCrawl tools inside the agent graph.Format: tvly-...Obtain: tavily.com
OpenAI API key. Required only when selecting an OpenAI model (GPT-5, GPT-5-mini, etc.) from the Streamlit sidebar.Format:
Obtain: platform.openai.com
sk-proj-...Obtain: platform.openai.com
Groq API key. Reserved for future Groq model support — not yet exposed in the UI but accepted by the backend.Format:
Obtain: console.groq.com
gsk_your-key-hereObtain: console.groq.com
The port on which the FastAPI backend listens inside the container (or on the host in local development). Matches the internal container port defined in
docker-compose.yml.Docker only. The host port mapped to the backend container’s
8080 port. Change this if port 8080 is already in use on your machine.Docker only. The host port mapped to the Streamlit frontend container. The default matches Streamlit’s own default port.
The URL the Streamlit frontend uses to reach the FastAPI backend. In Docker Compose this is automatically set to
http://backend:8080 (using the service name) so the frontend container can resolve it via the internal Docker network.- Local dev:
http://localhost:8080 - Docker Compose:
http://backend:8080(set automatically indocker-compose.yml)
Local Development
For local development, your.env file should look like the sample below. Uncomment the variables you need:
Docker Environment
When running via Docker Compose, the.env file is read by the Compose engine and injected into each service. The backend container receives all four API keys plus the PORT variable; the frontend container receives only BACKEND_URL so it knows where to send requests.
Passing Keys at Runtime
The Streamlit sidebar lets users supply their own API keys. When a key is entered in the sidebar, the frontend forwards it as an HTTP request header to the backend/stream_agent endpoint instead of relying on the server-side environment variable. This allows multiple users to share a single deployment while each using their own credentials.
| Header | Overrides | Provider |
|---|---|---|
X-Claude-Key | ANTHROPIC_API_KEY | Anthropic Claude |
X-Tavily-Key | TAVILY_API_KEY | Tavily Search |
X-OpenAI-Key | OPENAI_API_KEY | OpenAI |
X-Groq-Key | GROQ_API_KEY | Groq |
In a production deployment behind Nginx, keep
BACKEND_URL=http://backend:8080 in the frontend service environment. Using localhost inside a container refers to the container itself, not the backend service — the Docker service name backend is the correct hostname to use.