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

VariableMeaning
GRAY_HOMEconfig root (default ~/.gray)
GRAY_API_KEY · OPENAI_API_KEYAPI key — env beats stored keys
GRAY_MODELdefault model before ~/.gray/config.json is consulted
GRAY_BASE_URLdefault base URL
GRAY_CONTEXT_WINDOWoverride the window — 128000, 128k, 1m, or auto
GRAY_CONTEXT_RESERVEheadroom before auto-compact
GRAY_CONTEXT_KEEPtail kept beside the compaction summary
GRAY_MAX_TURNS · GRAY_MAX_COST_USD · GRAY_MAX_WALL_SECSrun caps
GRAY_PARALLEL_READS0 runs every tool sequentially (default: read-only tools run concurrently)
GRAY_NO_MEMORYrefuse every memory write
GRAY_NO_UPDATE_CHECK=1silence the startup update check
GRAY_AUTO_UPDATE=1self-update in the background (stable only)
GRAY_REGISTRY_URLpoint the plugin registry somewhere else
GRAY_PLUGIN_INDEXpoint plugin installs at another index
GRAY_PLUGIN_PATHexecutable to register with gray install plugin
GRAY_LOGlog level: error…trace (default info)

Join the Discord

Chat with the people building and running Gray. Show what you made with it.

Join Discord →

Need help?

Open an issue on GitHub, run /feedback from the REPL, or ask in Discord.

Open an issue →