# Environment variables
The variables pic reads. Variables that only the test suite sets are listed in `test/pic/docs.allow`
instead.
## API keys
A key or sign-in stored with `pic login` or `/login` is used before the provider's variable, as in
Pi. See [the lookup order](../manual/credentials.md#the-lookup-order).
| Variable | Provider |
|---|---|
| `ANTHROPIC_API_KEY` | anthropic |
| `OPENAI_API_KEY` | openai |
| `OPENROUTER_API_KEY` | openrouter |
| `XAI_API_KEY` | xai |
| `GROQ_API_KEY` | groq |
| `CEREBRAS_API_KEY` | cerebras |
| `DEEPSEEK_API_KEY` | deepseek |
| `FIREWORKS_API_KEY` | fireworks |
| `GEMINI_API_KEY` | google |
| `HF_TOKEN` | huggingface |
| `MOONSHOT_API_KEY` | moonshotai |
| `NVIDIA_API_KEY` | nvidia |
| `TOGETHER_API_KEY` | together |
| `ZAI_API_KEY` | zai |
## pic
| Variable | Values | What it does |
|---|---|---|
| `PIC_LAPSE` | on, off | lapse compaction, as `--lapse` (setting `lapseCompaction`) |
| `PIC_LAPSE_SECONDS` | seconds | the cache lifetime lapse compaction assumes, as `--lapse-seconds` |
| `PIC_LAPSE_FLOOR` | tokens | the context floor for lapse compaction, as `--lapse-floor` |
| `PIC_LAPSE_HOLDOUT` | 0 to 1 | the share of lapses left uncompacted, as the setting `lapseHoldout` |
| `PIC_TRIAL` | label | a benchmark arm kept on each request, as `--trial` |
| `PIC_PASSPHRASE_COMMAND` | shell command | prints the credential store's passphrase (its first line), instead of asking on the terminal; before the setting `passphraseCommand` |
| `PIC_MAX_REQUESTS` | N | the request cap, as `--max-requests` |
| `PIC_PI_EXPORT` | 0 | `0` stops `ask`, `chat` and the terminal from writing Pi session lines after each request |
| `PIC_MODELS_FILE` | path | read this file instead of `~/.pic/models.json` (and Pi's `~/.pi/agent/models.json`) |
| `PIC_MODEL_CATALOG` | offline | `offline` never fetches the model catalog; the built-in snapshot is used |
| `PIC_CA` | builtin | `builtin` skips the system certificate bundles and trusts only pic's built-in roots |
| `PIC_NO_NATIVE_CLIPBOARD` | any | the terminal interface does not use the system clipboard tools |
| `PIC_CODEMODE` | on, off | whether the codemode tool is offered, before the setting `codemode`; the terminal sets it for its requests after `/codemode` |
| `PIC_HOOK_OWNER` | id | set by the terminal interface for its request children, so `pic hooks end` ends what it began |
| `PIC_ORIGIN` | person, phone, agent, wake, headless | what starts this pic's conversations; unset, a person when one is at a terminal, else headless. pic sets it for what it starts, and only a person's and a phone's are listed on a phone |
| `PIC_PARENT` | JOURNAL/ID | with `PIC_ORIGIN=agent`, the conversation that started this pic; set by pic for its tool calls and hooks |
| `PIC_HOOK` | 1 | set by pic in a hook's environment |
| `PIC_VERIFY` | 1 | set by pic in the verify command's environment |
| `PI_CACHE_RETENTION` | long | as Pi's: the prompt cache retention when the `cacheRetention` setting is not set |
## System
| Variable | What pic does with it |
|---|---|
| `HOME` | `~/.pic` is under it |
| `USER` | the login name in `/remote-control`'s ssh command and address |
| `XDG_CONFIG_HOME` | where `pic remote install` writes its systemd user unit, instead of `~/.config` |
| `TMPDIR` | where the external editor's file and RPC mode's full output of a truncated bash command go; `pic remote` lists no workspace under it |
| `VISUAL` | the external editor (Ctrl+G), before `EDITOR` |
| `EDITOR` | the external editor when `VISUAL` is not set |
| `SSL_CERT_FILE` | an absolute path to a certificate bundle, read before the system bundles |
| `COLORTERM` | truecolor when it says so, otherwise the nearest of 256 colours |
| `COLORFGBG` | the terminal's background, for the `system` and `light/dark` themes |