Docs/Reference
Environment variables
Every environment variable the Gray AI agent reads, from the context window and API key to run caps, memory, plugins and log level.
Source: crates/gray/src/config.rs
| Variable | Meaning |
|---|---|
| GRAY_HOME | config root (default ~/.gray) |
| GRAY_API_KEY · OPENAI_API_KEY | API key — env beats stored keys |
| GRAY_MODEL | default model before ~/.gray/config.json is consulted |
| GRAY_BASE_URL | default base URL |
| GRAY_CONTEXT_WINDOW | override the window — 128000, 128k, 1m, or auto |
| GRAY_CONTEXT_RESERVE | headroom before auto-compact |
| GRAY_CONTEXT_KEEP | tail kept beside the compaction summary |
| GRAY_MAX_TURNS · GRAY_MAX_COST_USD · GRAY_MAX_WALL_SECS | run caps |
| GRAY_PARALLEL_READS | 0 runs every tool sequentially (default: read-only tools run concurrently) |
| GRAY_NO_MEMORY | refuse every memory write |
| GRAY_NO_UPDATE_CHECK=1 | silence the startup update check |
| GRAY_AUTO_UPDATE=1 | self-update in the background (stable only) |
| GRAY_REGISTRY_URL | point the plugin registry somewhere else |
| GRAY_PLUGIN_INDEX | point plugin installs at another index |
| GRAY_PLUGIN_PATH | executable to register with gray install plugin |
| GRAY_LOG | log level: error…trace (default info) |
Join the Discord
Chat with the people building and running Gray. Show what you made with it.
Join Discord →